Ejemplo n.º 1
0
        void AddChild(object item)
        {
            ModifiedItem modItem = (ModifiedItem)item;
            Node         newNode = (Node)Activator.CreateInstance(Type.GetType(modItem.newType));

            modItem.node.AddChild(newNode);
            ModifiedTreeLastFrame = true;
        }
Ejemplo n.º 2
0
        void ChangeNode(object item)
        {
            ModifiedItem modItem = (ModifiedItem)item;
            Node         newNode = (Node)Activator.CreateInstance(Type.GetType(modItem.newType));
            //modItem.node = newNode; //not work, but why?

            int index = modItem.node.parent.Children.IndexOf(modItem.node);

            modItem.node.parent.Children[index] = newNode;
            ModifiedTreeLastFrame = true;
        }