Example #1
0
 public void Remove(Shapes.DiagramShape obj)
 {
     if (obj != null)
     {
         DiagramLayer layer1 = obj.Layer;
         if (layer1 != null)
         {
             if (layer1 != this)
             {
                 throw new ArgumentException("Cannot remove an object from a layer if it does not belong to that layer.");
             }
             Shapes.GroupShape group1 = obj.Parent;
             if (group1 != null)
             {
                 group1.Remove(obj);
             }
             else
             {
                 this.removeFromLayer(obj, false);
             }
         }
     }
     if (this.ShapeRemoved != null)
     {
         this.ShapeRemoved(this, new SelectionEventArgs(obj));
     }
 }