Example #1
0
File: Form1.cs Project: fel88/ATree
        private void AddRootToolStripMenuItem_Click(object sender, EventArgs e)
        {
            var a = new AItem()
            {
                Name = "new root1"
            };

            AllItems.Add(a);
        }
Example #2
0
File: Form1.cs Project: fel88/ATree
        public void AddChildToSelected()
        {
            if (selected == null)
            {
                return;
            }
            var a = new AItem()
            {
                Name = "new node1", Position = new PointF(selected.Position.X + selected.Radius * 2, selected.Position.Y)
            };

            selected.AddChild(a);
            AllItems.Add(a);
        }
Example #3
0
File: Form1.cs Project: fel88/ATree
        public void SampleTree()
        {
            AItem Root = new AItem()
            {
                Name = "Happy life"
            };

            Root.AddChild(new AItem()
            {
                Name = "child1", Position = new PointF(200, 0), Progress = 45, IsProgress = true
            });

            AllItems.Add(Root);
            AllItems.AddRange(Root.Childs);
        }
Example #4
0
File: AItem.cs Project: fel88/ATree
 internal void AddChild(AItem aItem)
 {
     Childs.Add(aItem);
     aItem.Parents.Add(this);
 }