예제 #1
0
        public static SerializedTabGroupWindow Create(IDocumentTabContentFactoryService factory, ITabGroupService tabGroupService, string name)
        {
            int index = tabGroupService.TabGroups.ToList().IndexOf(tabGroupService.ActiveTabGroup);
            var stackedContentState = ((TabGroupService)tabGroupService).StackedContentState;
            var tgw = new SerializedTabGroupWindow(name, index, tabGroupService.IsHorizontal, stackedContentState);

            foreach (var g in tabGroupService.TabGroups)
            {
                tgw.TabGroups.Add(SerializedTabGroup.Create(factory, g));
            }

            return(tgw);
        }
예제 #2
0
        public static SerializedTabGroupWindow Load(ISettingsSection section)
        {
            var  name                = section.Attribute <string>(NAME_ATTR) ?? MAIN_NAME;
            int  index               = section.Attribute <int?>(INDEX_ATTR) ?? -1;
            bool isHorizontal        = section.Attribute <bool?>(ISHORIZONTAL_ATTR) ?? false;
            var  stackedContentState = StackedContentStateSerializer.TryDeserialize(section.GetOrCreateSection(STACKEDCONTENTSTATE_SECTION));
            var  tgw = new SerializedTabGroupWindow(name, index, isHorizontal, stackedContentState);

            foreach (var tgSection in section.SectionsWithName(TABGROUP_SECTION))
            {
                tgw.TabGroups.Add(SerializedTabGroup.Load(tgSection));
            }

            return(tgw);
        }
예제 #3
0
        public static SerializedTabGroup Create(IDocumentTabContentFactoryService documentTabContentFactoryService, ITabGroup g)
        {
            int index = g.TabContents.ToList().IndexOf(g.ActiveTabContent);
            var tg    = new SerializedTabGroup(index);

            foreach (IDocumentTab tab in g.TabContents)
            {
                var t = SerializedTab.TryCreate(documentTabContentFactoryService, tab);
                if (t != null)
                {
                    tg.Tabs.Add(t);
                }
            }

            return(tg);
        }
예제 #4
0
        public static SerializedTabGroup Load(ISettingsSection section)
        {
            int index = section.Attribute <int?>(INDEX_ATTR) ?? -1;
            var tg    = new SerializedTabGroup(index);

            foreach (var tabSection in section.SectionsWithName(TAB_SECTION))
            {
                var tab = SerializedTab.TryLoad(tabSection);
                if (tab != null)
                {
                    tg.Tabs.Add(tab);
                }
            }

            return(tg);
        }
예제 #5
0
		public static SerializedTabGroup Create(IDocumentTabContentFactoryService documentTabContentFactoryService, ITabGroup g) {
			int index = g.TabContents.ToList().IndexOf(g.ActiveTabContent);
			var tg = new SerializedTabGroup(index);

			foreach (IDocumentTab tab in g.TabContents) {
				var t = SerializedTab.TryCreate(documentTabContentFactoryService, tab);
				if (t != null)
					tg.Tabs.Add(t);
			}

			return tg;
		}
예제 #6
0
		public static SerializedTabGroup Load(ISettingsSection section) {
			int index = section.Attribute<int?>(INDEX_ATTR) ?? -1;
			var tg = new SerializedTabGroup(index);

			foreach (var tabSection in section.SectionsWithName(TAB_SECTION)) {
				var tab = SerializedTab.TryLoad(tabSection);
				if (tab != null)
					tg.Tabs.Add(tab);
			}

			return tg;
		}