/// <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); }
/// <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; }