diff options
| author | Michael <[email protected]> | 2017-06-10 10:17:10 -0400 |
|---|---|---|
| committer | Michael <[email protected]> | 2017-06-10 10:17:15 -0400 |
| commit | c40d071d58859e25b3781299b949b91caa0548fe (patch) | |
| tree | d26956e6a06336af403e05cfe0ace0e50ff1b6ea /ShiftOS.WinForms/WinformsDesktop.cs | |
| parent | 7dd109719be8a9e8b52655665f490f4f7956df80 (diff) | |
| download | shiftos_thereturn-c40d071d58859e25b3781299b949b91caa0548fe.tar.gz shiftos_thereturn-c40d071d58859e25b3781299b949b91caa0548fe.tar.bz2 shiftos_thereturn-c40d071d58859e25b3781299b949b91caa0548fe.zip | |
main menu system + sandbox mode
Diffstat (limited to 'ShiftOS.WinForms/WinformsDesktop.cs')
| -rw-r--r-- | ShiftOS.WinForms/WinformsDesktop.cs | 32 |
1 files changed, 23 insertions, 9 deletions
diff --git a/ShiftOS.WinForms/WinformsDesktop.cs b/ShiftOS.WinForms/WinformsDesktop.cs index 4614842..f6c4383 100644 --- a/ShiftOS.WinForms/WinformsDesktop.cs +++ b/ShiftOS.WinForms/WinformsDesktop.cs @@ -50,6 +50,8 @@ namespace ShiftOS.WinForms [Namespace("desktop")] public partial class WinformsDesktop : Form, IDesktop { + public MainMenu.MainMenu ParentMenu = null; + [Command("pushnote")] [RequiresArgument("target")] [RequiresArgument("title")] @@ -921,7 +923,7 @@ namespace ShiftOS.WinForms /// <param name="e">E.</param> private void Desktop_Load(object sender, EventArgs e) { - + SaveSystem.IsSandbox = this.IsSandbox; SaveSystem.Begin(); SetupDesktop(); @@ -964,6 +966,7 @@ namespace ShiftOS.WinForms } private IWindowBorder focused = null; + internal bool IsSandbox = false; public string DesktopName { @@ -1033,10 +1036,17 @@ namespace ShiftOS.WinForms { try { - this.Invoke(new Action(() => + if (this.Visible == true) { - act?.Invoke(); - })); + this.Invoke(new Action(() => + { + act?.Invoke(); + })); + } + else + { + ParentMenu?.Invoke(act); + } } catch { @@ -1105,12 +1115,16 @@ namespace ShiftOS.WinForms public void HideAppLauncher() { - this.Invoke(new Action(() => + try { - currentSettingsPane?.Hide(); - currentSettingsPane = null; - pnladvancedal.Hide(); - })); + this.Invoke(new Action(() => + { + currentSettingsPane?.Hide(); + currentSettingsPane = null; + pnladvancedal.Hide(); + })); + } + catch { } } } |
