Exemplo n.º 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));
        }
Exemplo n.º 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);
        }
Exemplo n.º 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;
        }
Exemplo n.º 4
0
 private static void Save(object sender, EventArgs e)
 {
     HiddenWindowStore.Save((HiddenWindowStore)sender);
 }