Show() public method

Switches input to the currently opened desktop.
public Show ( ) : bool
return bool
Example #1
0
        /// <summary>
        ///     Switches to the specified desktop.
        /// </summary>
        /// <param name="name">Name of desktop to switch input to.</param>
        /// <returns>True if desktops were successfully switched.</returns>
        public static bool Show(string name)
        {
            // attmempt to open desktop.
            var result = false;

            using (var d = new Desktop())
            {
                result = d.Open(name);

                // something went wrong.
                if (!result)
                {
                    return(false);
                }

                // attempt to switch desktops.
                result = d.Show();
            }

            return(result);
        }
Example #2
0
        /// <summary>
        ///     Switches to the specified desktop.
        /// </summary>
        /// <param name="name">Name of desktop to switch input to.</param>
        /// <returns>True if desktops were successfully switched.</returns>
        public static bool Show(string name)
        {
            // attmempt to open desktop.
            var result = false;

            using (var d = new Desktop())
            {
                result = d.Open(name);

                // something went wrong.
                if (!result) return false;

                // attempt to switch desktops.
                result = d.Show();
            }

            return result;
        }