コード例 #1
0
        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);
        }
コード例 #2
0
ファイル: Serializer.cs プロジェクト: th851dan/doobry
        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);
        }