private void UpdateAssociatedNodeLocationString() { if (AssociatedNode != null && AssociatedNode.IsRooted) //@AssociateNode { ObiNode iterationNode = AssociatedNode; m_AssociatedNodeLocation = ""; while (iterationNode != this.Root) { if (AssociatedNode != iterationNode) { m_AssociatedNodeLocation += "_"; } m_AssociatedNodeLocation += iterationNode.Parent.Children.IndexOf(iterationNode).ToString(); iterationNode = iterationNode.ParentAs <ObiNode>(); } } }
/// <summary> /// Find the parent node for a new node to be added at the current selection. /// The new node can either be a SectionNode or an EmtpyNode. /// The rule is to add inside containers and after cursor/phrase block. /// </summary> public virtual ObiNode ParentForNewNode(ObiNode newNode) { return(newNode is SectionNode ? (Node is SectionNode ? Node.ParentAs <ObiNode>() : Node.AncestorAs <SectionNode>()) : (Node is SectionNode ? Node : Node.ParentAs <ObiNode>())); }