Exemplo n.º 1
0
 public NodeData()
 {
     children = new List<NodeData> ();
     data = new Hashtable ();
     parent = null;
     log = new LogUtil ("NodeData");
 }
Exemplo n.º 2
0
 public override bool CanMakeChild(NodeData childData)
 {
     return this.CanMakeChild (childData.nodeType);
 }
Exemplo n.º 3
0
 public NewCategory(NodeData _providerNode)
     : base(Gtk.WindowType.Toplevel)
 {
     providerNode = _providerNode;
     this.Build ();
 }
Exemplo n.º 4
0
 public override void OnNodeDataChanged(NodeData source, NodeDataChangedEventArgs args)
 {
     if (source is CategoryData) {
         // get the tree builder
         ITreeBuilder treeBuilder = Context.GetTreeBuilder (source);
         treeBuilder.UpdateAll ();
     }
 }
Exemplo n.º 5
0
 /// <summary>
 /// Used to nest categories.
 /// 
 /// TODO: Migrate createnewcategory to use this function instead
 /// </summary>
 /// <param name="parent">
 /// A <see cref="NodeData"/>
 /// </param>
 public void AddChildCategory(NodeData parent)
 {
     NewCategory n = new NewCategory (parent);
     log.INFO ("Making new category with parent - " + parent.Label);
     n.ShowAll ();
 }
Exemplo n.º 6
0
        public virtual void AddChild(NodeData childData)
        {
            // Check if this node can have this as a child
            if(CanMakeChild(childData))
            {
                // First, remove the child from it's parent list
                childData.parent.children.Remove(childData);

                // set the child data's parent to the current object
                childData.parent = this;

                // add the child data as a child
                this.children.Add(childData);

                // Inform both classes about the updates
            }
        }
Exemplo n.º 7
0
 public override bool CanMakeChild(NodeData childData);
Exemplo n.º 8
0
 public abstract bool CanMakeChild(NodeData childData);
Exemplo n.º 9
0
        /// <summary>
        /// Adds a child and does not update GUI. to be used when heavy
        /// tree activity is taking place 
        /// 
        /// YOU HAVE TO CALL TriggerUpdate after finishing tree opeartions
        /// </summary>
        /// <param name="childData">
        /// A <see cref="NodeData"/>
        /// </param>
        public virtual void AddChildSilent(NodeData childData)
        {
            // Check if this node can have this as a child
            if (CanMakeChild (childData)) {
                // First, remove the child from it's parent list
                NodeData oldParent = childData.parent;

                if (oldParent != null)
                    childData.parent.children.Remove (childData);

                // set the child data's parent to the current object
                childData.parent = this;

                // add the child data as a child
                this.children.Add (childData);

                // Inform both classes about the updates
                //this.TriggerUpdate();

            }
        }