public static void SetRealParent(this SemanticNode semanticNode, SemanticGraph semanticGraph, XmlDocument xmlDoc) { var realParentNode = semanticGraph.FindCluster(semanticNode.MediatorNodeParent); var mediatorNodeParent = realParentNode.XmlNode ?? realParentNode.XmlNode(semanticGraph, xmlDoc); mediatorNodeParent.AppendChild(semanticNode.XmlNode ?? semanticNode.XmlNode(xmlDoc)); }
public static void SetRealParent(this SemanticCluster semanticCluster, SemanticGraph semanticGraph, XmlDocument xmlDoc) { var realParentNode = semanticGraph.FindCluster(semanticCluster.MediatorNodeParent) ?? semanticGraph.FindNode(semanticCluster.MediatorNodeParent); var mediatorNodeParent = realParentNode.XmlNode ?? (realParentNode is SemanticCluster cluster ? cluster.XmlNode(semanticGraph, xmlDoc) : realParentNode.XmlNode(xmlDoc)); mediatorNodeParent.AppendChild(semanticCluster.XmlNode ?? semanticCluster.XmlNode(semanticGraph, xmlDoc)); }