Пример #1
0
        private JObject SerializeCodeblockTreeToJObject(CodeblockTree tree)
        {
            JObject mainChain   = SerializeCodeblockChainToJObject(tree.MainChain);
            JArray  looseChains = new JArray(tree.LooseChains.Select(looseChain => SerializeCodeblockChainToJObject(looseChain)).ToArray());

            JObject obj = new JObject()
            {
                { "mainChain", mainChain },
                { "looseChains", looseChains }
            };

            return(obj);
        }
Пример #2
0
 public string SerializeCodeblockTree(CodeblockTree tree)
 => SerializeCodeblockTreeToJObject(tree).ToString(SerializerSettings.ToJsonSettings().Formatting);