Ejemplo n.º 1
0
        public void Initialize(IStackedContentChild mainChild, MainWindowControlState state)
        {
            horizontalContent.AddChild(verticalContent);
            verticalContent.AddChild(mainChild, StackedContentChildInfo.CreateVertical(new GridLength(1, GridUnitType.Star), 30));

            foreach (var kv in state.SavedLocations)
            {
                savedLocations[kv.Key] = kv.Value;
            }

            if (state.LeftState != null && state.RightState != null && state.TopState != null && state.BottomState != null)
            {
                state.LeftState.Restore(this, toolWindowUIs[AppToolWindowLocation.Left]);
                state.RightState.Restore(this, toolWindowUIs[AppToolWindowLocation.Right]);
                state.TopState.Restore(this, toolWindowUIs[AppToolWindowLocation.Top]);
                state.BottomState.Restore(this, toolWindowUIs[AppToolWindowLocation.Bottom]);
            }
            else
            {
                RestoreDefault();
            }

            if (state.HorizontalContentState != null && state.VerticalContentState != null)
            {
                horizontalContent.State = state.HorizontalContentState;
                verticalContent.State   = state.VerticalContentState;
            }
        }
Ejemplo n.º 2
0
        public MainWindowControlState CreateState()
        {
            var state = new MainWindowControlState();

            state.HorizontalContentState = horizontalContent.State;
            state.VerticalContentState   = verticalContent.State;
            state.LeftState   = new ToolWindowUIState().Save(AppToolWindowLocation.Left, toolWindowUIs[AppToolWindowLocation.Left]);
            state.RightState  = new ToolWindowUIState().Save(AppToolWindowLocation.Right, toolWindowUIs[AppToolWindowLocation.Right]);
            state.TopState    = new ToolWindowUIState().Save(AppToolWindowLocation.Top, toolWindowUIs[AppToolWindowLocation.Top]);
            state.BottomState = new ToolWindowUIState().Save(AppToolWindowLocation.Bottom, toolWindowUIs[AppToolWindowLocation.Bottom]);
            foreach (var kv in savedLocations)
            {
                state.SavedLocations[kv.Key] = kv.Value;
            }
            foreach (var ui in toolWindowUIs.Values)
            {
                foreach (var g in ui.ToolWindowGroupManager.TabGroups)
                {
                    foreach (var c in g.TabContents)
                    {
                        state.SavedLocations[c.Guid] = ui.Location;
                    }
                }
            }
            return(state);
        }
Ejemplo n.º 3
0
            public void Write()
            {
                var sect = settingsService.RecreateSection(SETTINGS_GUID);

                SavedWindowState.Write(sect.GetOrCreateSection(SAVEDWINDOWSTATE_SECTION));
                MainWindowControlState.Write(sect.GetOrCreateSection(MAINWINDOWCONTROLSTATE_SECTION));
            }
Ejemplo n.º 4
0
            public void Read()
            {
                var sect = settingsManager.GetOrCreateSection(SETTINGS_GUID);

                this.SavedWindowState       = new SavedWindowState().Read(sect.GetOrCreateSection(SAVEDWINDOWSTATE_SECTION));
                this.MainWindowControlState = new MainWindowControlState().Read(sect.GetOrCreateSection(MAINWINDOWCONTROLSTATE_SECTION));
            }
Ejemplo n.º 5
0
			public void Read() {
				var sect = settingsService.GetOrCreateSection(SETTINGS_GUID);
				SavedWindowState = new SavedWindowState().Read(sect.GetOrCreateSection(SAVEDWINDOWSTATE_SECTION));
				MainWindowControlState = new MainWindowControlState().Read(sect.GetOrCreateSection(MAINWINDOWCONTROLSTATE_SECTION));
			}
Ejemplo n.º 6
0
        public void Initialize(IStackedContentChild mainChild, MainWindowControlState state)
        {
            horizontalContent.AddChild(verticalContent);
            verticalContent.AddChild(mainChild, StackedContentChildInfo.CreateVertical(new GridLength(1, GridUnitType.Star), 30));

            foreach (var kv in state.SavedLocations)
                savedLocations[kv.Key] = kv.Value;

            if (state.LeftState != null && state.RightState != null && state.TopState != null && state.BottomState != null) {
                state.LeftState.Restore(this, toolWindowUIs[AppToolWindowLocation.Left]);
                state.RightState.Restore(this, toolWindowUIs[AppToolWindowLocation.Right]);
                state.TopState.Restore(this, toolWindowUIs[AppToolWindowLocation.Top]);
                state.BottomState.Restore(this, toolWindowUIs[AppToolWindowLocation.Bottom]);
            }
            else
                RestoreDefault();

            if (state.HorizontalContentState != null && state.VerticalContentState != null) {
                horizontalContent.State = state.HorizontalContentState;
                verticalContent.State = state.VerticalContentState;
            }
        }
Ejemplo n.º 7
0
 public MainWindowControlState CreateState()
 {
     var state = new MainWindowControlState();
     state.HorizontalContentState = horizontalContent.State;
     state.VerticalContentState = verticalContent.State;
     state.LeftState = new ToolWindowUIState().Save(AppToolWindowLocation.Left, toolWindowUIs[AppToolWindowLocation.Left]);
     state.RightState = new ToolWindowUIState().Save(AppToolWindowLocation.Right, toolWindowUIs[AppToolWindowLocation.Right]);
     state.TopState = new ToolWindowUIState().Save(AppToolWindowLocation.Top, toolWindowUIs[AppToolWindowLocation.Top]);
     state.BottomState = new ToolWindowUIState().Save(AppToolWindowLocation.Bottom, toolWindowUIs[AppToolWindowLocation.Bottom]);
     foreach (var kv in savedLocations)
         state.SavedLocations[kv.Key] = kv.Value;
     foreach (var ui in toolWindowUIs.Values) {
         foreach (var g in ui.ToolWindowGroupManager.TabGroups) {
             foreach (var c in g.TabContents)
                 state.SavedLocations[c.Guid] = ui.Location;
         }
     }
     return state;
 }