Hyena.Query.QueryListNode.ReplaceChild C# (CSharp) Method

ReplaceChild() public method

public ReplaceChild ( QueryNode old_child, QueryNode new_child ) : void
old_child QueryNode
new_child QueryNode
return void
        public void ReplaceChild(QueryNode old_child, QueryNode new_child)
        {
            int index = children.IndexOf(old_child);
            if(index < 0) {
                throw new ApplicationException("old_child does not exist");
            }

            children.RemoveAt(index);
            children.Insert(index, new_child);
        }