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); }
public string SerializeCodeblockTree(CodeblockTree tree) => SerializeCodeblockTreeToJObject(tree).ToString(SerializerSettings.ToJsonSettings().Formatting);