示例#1
0
		SerializedTabGroupWindow(string name, int index, bool isHorizontal, StackedContentState stackedContentState) {
			this.name = name;
			this.index = index;
			this.isHorizontal = isHorizontal;
			this.tabGroups = new List<SerializedTabGroup>();
			this.stackedContentState = stackedContentState;
		}
示例#2
0
 SerializedTabGroupWindow(string name, int index, bool isHorizontal, StackedContentState stackedContentState)
 {
     Name                = name;
     Index               = index;
     IsHorizontal        = isHorizontal;
     TabGroups           = new List <SerializedTabGroup>();
     StackedContentState = stackedContentState;
 }
示例#3
0
        public ToolWindowUIState Save(AppToolWindowLocation location, MainWindowControl.ToolWindowUI ui)
        {
            this.Location            = location;
            this.StackedContentState = ((ToolWindowGroupManager)ui.ToolWindowGroupManager).StackedContentState;
            var groups = ui.ToolWindowGroupManager.TabGroups.ToList();

            this.Index        = groups.IndexOf(ui.ToolWindowGroupManager.ActiveTabGroup);
            this.IsHorizontal = ui.ToolWindowGroupManager.IsHorizontal;
            foreach (var g in groups)
            {
                Groups.Add(new ToolWindowGroupState().Save(g));
            }
            return(this);
        }
示例#4
0
        public MainWindowControlState Read(ISettingsSection section)
        {
            HorizontalContentState = StackedContentStateSerializer.TryDeserialize(section.GetOrCreateSection(HORIZONTALCONTENT_SECT));
            VerticalContentState   = StackedContentStateSerializer.TryDeserialize(section.GetOrCreateSection(VERTICALCONTENT_SECT));

            foreach (var twSect in section.SectionsWithName(TOOLWINDOWUI_SECT))
            {
                var state = ToolWindowUIState.TryDeserialize(twSect);
                if (state == null)
                {
                    continue;
                }
                switch (state.Location)
                {
                case AppToolWindowLocation.Left:        LeftState = state; break;

                case AppToolWindowLocation.Right:       RightState = state; break;

                case AppToolWindowLocation.Top:         TopState = state; break;

                case AppToolWindowLocation.Bottom:      BottomState = state; break;
                }
            }

            foreach (var locSect in section.SectionsWithName(LOCATION_SECT))
            {
                var guid = locSect.Attribute <Guid?>(LOCATION_GUID_ATTR);
                var loc  = locSect.Attribute <AppToolWindowLocation?>(LOCATION_ATTR);
                if (guid == null || loc == null)
                {
                    continue;
                }
                if (!IsValid(loc.Value))
                {
                    continue;
                }
                SavedLocations[guid.Value] = loc.Value;
            }

            return(this);
        }