private void CorrectClusterCodes() { foreach (var c in EnumerateSubGraphs()) { c.Code = DotLanguageUtils.GetClusterCode(c.Code); } foreach (var n in EnumerateNodes().Where(_ => !string.IsNullOrWhiteSpace(_.SubgraphCode))) { n.SubgraphCode = DotLanguageUtils.GetClusterCode(n.SubgraphCode); } }
/// <summary> /// </summary> /// <param name="code"></param> /// <returns></returns> public SubGraph ResolveSubgraph(string code) { var __code = DotLanguageUtils.GetClusterCode(code); if (Code == __code) { return(this); } var result = SubGraphs.Select(sg => sg.ResolveSubgraph(__code)).FirstOrDefault(_ => null != _); return(result); }