internal static void Save(HiddenWindowStore store) { HiddenWindowStore.RaiseFileNotification(store, new FileEventArgs(HiddenWindowStore.StorageFileName, FileEventTypes.Saving)); store.SaveFile(); HiddenWindowStore.RaiseFileNotification(store, new FileEventArgs(HiddenWindowStore.StorageFileName, FileEventTypes.Saved)); }
internal static HiddenWindowStore Load() { bool wasCreated; HiddenWindowStore.RaiseFileNotification(new FileEventArgs(HiddenWindowStore.StorageFileName, FileEventTypes.Opening)); HiddenWindowStore returnValue = LoadFile <HiddenWindowStore>(out wasCreated); HiddenWindowStore.RaiseFileNotification(new FileEventArgs(HiddenWindowStore.StorageFileName, FileEventTypes.Loaded)); return(returnValue); }
public void RegisterHandlers(WindowInfo window = null) { if (window == null) { window = WindowInfo.Find(this.Handle); } if (!Runtime.Instance.WindowManager.Exists(window) || this.handlersRegistered) { return; } window.OriginalState = this.LastState; window.IsPinned = this.IsPinned; window.Hidden += (s, e) => { this.State |= WindowStates.Hidden; }; window.Shown += (s, e) => { this.State &= ~WindowStates.Hidden; }; window.Pinned += (s, e) => { this.State |= WindowStates.Pinned; }; window.Unpinned += (s, e) => { this.State &= ~WindowStates.Pinned; }; window.Locked += (s, e) => { this.State |= WindowStates.Protected; }; window.Unlocked += (s, e) => { this.State &= ~WindowStates.Protected; }; this.StateChanged += (s, e) => { HiddenWindowStore.Save(Runtime.Instance.Store); }; this.handlersRegistered = true; }
private static void Save(object sender, EventArgs e) { HiddenWindowStore.Save((HiddenWindowStore)sender); }