public void Add(PsiFunctionsVariablesNode child)
 {
     if (!Children.Contains(child))
     {
         child.Parent = this;
         Children.Add(child);
     }
 }
 public void CopyMarksFrom(PsiFunctionsVariablesNode node)
 {
     IsMarked = node.IsMarked;
     for (int i = 0; i < ChildrenCount; i++)
         (Children[i] as PsiFunctionsVariablesNode).CopyMarksFrom(node.Children[i] as PsiFunctionsVariablesNode);
 }
        public bool StructuralEquals(PsiFunctionsVariablesNode node)
        {
            if (BlockType != node.BlockType || Value != node.Value)
                return false;
            if (ChildrenCount != node.ChildrenCount)
                return false;

            for (int i = 0; i < ChildrenCount; i++)
                if (!(Children[i] as PsiFunctionsVariablesNode).StructuralEquals(node.Children[i] as PsiFunctionsVariablesNode))
                    return false;

            return true;
        }
        private void CreateNewNode(string value, BlockType type, Interval interval, bool[] viewConfig, bool pop)
        {
            var node = new PsiFunctionsVariablesNode();
            node.Value = value;
            node.Interval = interval;
            node.BlockType = type;
            node.ViewConfig = viewConfig;

            if(pop) lastCreatedNodeListStack.Pop().ForEach(item => node.Add(item));

            lastCreatedNodeListStack.Peek().Add(node);
        }