UlteriusServer.Api.Win32.Desktop.Exists C# (CSharp) Method

Exists() public static method

Checks if the specified desktop exists.
public static Exists ( string name, bool caseInsensitive ) : bool
name string The name of the desktop.
caseInsensitive bool If the search is case INsensitive.
return bool
        public static bool Exists(string name, bool caseInsensitive)
        {
            // enumerate desktops.
            var desktops = GetDesktops();

            // return true if desktop exists.
            foreach (var desktop in desktops)
            {
                if (caseInsensitive)
                {
                    // case insensitive, compare all in lower case.
                    if (desktop.ToLower() == name.ToLower()) return true;
                }
                else
                {
                    if (desktop == name) return true;
                }
            }

            return false;
        }

Same methods

Desktop::Exists ( string name ) : bool