예제 #1
0
        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));
        }
예제 #2
0
        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);
        }
예제 #3
0
        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;
        }
예제 #4
0
 private static void Save(object sender, EventArgs e)
 {
     HiddenWindowStore.Save((HiddenWindowStore)sender);
 }