Esempio n. 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);
        }
Esempio n. 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);
        }
Esempio n. 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);
        }
Esempio n. 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);
        }
Esempio n. 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;
		}
Esempio n. 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;
		}