Exemple #1
0
 private void removeAt(int index, DiagramShape obj, bool undoing)
 {
     try
     {
         obj.SetBeingRemoved(true);
         if (undoing)
         {
             int num1 = this.myObjects.IndexOf(obj);
             if (num1 >= 0)
             {
                 if ((index < 0) || (index >= this.myObjects.Count))
                 {
                     index = num1;
                 }
                 this.myObjects.RemoveAt(index);
             }
         }
         else
         {
             this.myObjects.RemoveAt(index);
         }
         RectangleF ef1 = obj.Bounds;
         this.Changed(0x41c, index, obj, ef1, 0, null, DiagramShape.NullRect);
         if (!undoing)
         {
             this.LayoutChildren(obj);
             base.InvalidBounds = true;
             RectangleF ef2 = this.Bounds;
         }
     }
     catch (Exception exception1)
     {
         DiagramShape.Trace("GoGroup.Remove: " + exception1.ToString());
         throw exception1;
     }
     finally
     {
         obj.SetParent(null, undoing);
         obj.SetBeingRemoved(false);
     }
 }
Exemple #2
0
 private void replaceAt(int index, DiagramShape newobj, bool undoing)
 {
     DiagramShape obj1 = (DiagramShape)this.myObjects[index];
     obj1.SetBeingRemoved(true);
     obj1.SetParent(null, undoing);
     obj1.SetBeingRemoved(false);
     this.myObjects[index] = newobj;
     RectangleF ef1 = newobj.Bounds;
     newobj.SetParent(this, undoing);
     this.Changed(0x41e, index, obj1, DiagramShape.NullRect, index, newobj, DiagramShape.NullRect);
     if (!undoing)
     {
         this.LayoutChildren(newobj);
         base.InvalidBounds = true;
         RectangleF ef2 = this.Bounds;
     }
 }
Exemple #3
0
 private void insertAt(int idx, DiagramShape obj, bool undoing)
 {
     RectangleF ef1 = obj.Bounds;
     if (!undoing || (this.myObjects.IndexOf(obj) < 0))
     {
         if ((idx < 0) || (idx > this.myObjects.Count))
         {
             idx = this.myObjects.Count;
         }
         this.myObjects.Insert(idx, obj);
     }
     obj.SetParent(this, undoing);
     this.Changed(0x41b, 0, null, DiagramShape.NullRect, idx, obj, ef1);
     if (!undoing)
     {
         this.LayoutChildren(obj);
         base.InvalidBounds = true;
         RectangleF ef2 = this.Bounds;
     }
 }