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); }
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); }