Esempio n. 1
0
        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));
        }