Exemplo n.º 1
0
 //todo removerandom
 internal void CreateRandom(int maxNestedCount,int maxChildCount)
 {
     int maxNestedCountCore = maxNestedCount;
     for(int i = 0; i <DiagramConstant.Random.Next(1,maxChildCount); i++) {
         GraphItem item = new GraphItem(Owner);
         if(maxNestedCountCore > 0) {
             maxNestedCountCore--;
             item.CreateRandom(maxNestedCountCore, maxChildCount);
         }
         ChildItems.Add(item);
     }
 }
Exemplo n.º 2
0
 private void generateGraph(object sender, EventArgs e)
 {
     clear(null, null);
     GraphItem graphItem = new GraphItem(helper);
     graphItem.CreateRandom(10,4);
     helper.AddGraphItem(graphItem);
 }