private static void DocumentTabSet(Guid id, TabablzControl tabablzControl, ICollection <LayoutStructureTabSet> layoutStructureTabSets) { var selectedTabItemId = (tabablzControl.SelectedItem as TabItemContainer)?.TabId; var layoutStructureTabSet = new LayoutStructureTabSet( id, selectedTabItemId, tabablzControl.Items.OfType <TabItemContainer>() .Select(tic => new LayoutStructureTabItem(tic.TabId, tic.FeatureId, tic.ViewModel, tic.BackingStoreWriter)) ); layoutStructureTabSets.Add(layoutStructureTabSet); }
private static JObject ToJson(LayoutStructureTabSet tabSet) { if (tabSet == null) { throw new ArgumentNullException(nameof(tabSet)); } dynamic ts = new JObject(); ts.id = tabSet.Id; ts.selectedTabItemId = tabSet.SelectedTabItemId; ts.tabItems = new JArray(tabSet.TabItems.Select(ToJson)); return(ts); }