public static SerializedTabGroup Create(IFileTabContentFactoryManager creator, ITabGroup g) { int index = g.TabContents.ToList().IndexOf(g.ActiveTabContent); var tg = new SerializedTabGroup(index); foreach (IFileTab tab in g.TabContents) { var t = SerializedTab.TryCreate(creator, 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; }