private void LinkState(IAppState appState, bool Link) { if (Link) { appState?.Load(); if (appState.StateKeyboardLayout != null) { keyboard?.AddRange(appState.StateKeyboardLayout); } //if (appState.GUI != null) //Myra.Graphics2D.UI.Desktop.Widgets.Add(appState.GUI); } else { appState?.Save(); if (appState.StateKeyboardLayout != null) { keyboard?.RemoveRange(appState.StateKeyboardLayout); } //if (appState.GUI != null) //Myra.Graphics2D.UI.Desktop.Widgets.Remove(appState.GUI ?? null); } }
protected override void OnClosing(CancelEventArgs e) { _appState.Save(); }
protected override void OnClosed(EventArgs e) { base.OnClosed(e); _appState.Save(); }