Ejemplo n.º 1
0
 public void Remove(DiagramLayer layer)
 {
     if (layer != null)
     {
         int num1 = this.IndexOf(layer);
         if (num1 >= 0)
         {
             if (layer.LayerCollectionContainer == this.LayerCollectionContainer)
             {
                 layer.Clear();
             }
             DiagramLayer layer1 = null;
             foreach (DiagramLayer layer2 in this.myLayers)
             {
                 if ((layer2 != layer) && (layer2.LayerCollectionContainer == this.LayerCollectionContainer))
                 {
                     layer1 = layer2;
                     break;
                 }
             }
             if (layer1 != null)
             {
                 DiagramLayer layer3 = null;
                 if ((num1 + 1) < this.myLayers.Count)
                 {
                     layer3 = (DiagramLayer)this.myLayers[num1 + 1];
                 }
                 this.myLayers.RemoveAt(num1);
                 this.LayerCollectionContainer.RaiseChanged(0x322, 0, layer, 0, layer3, LayerCollection.NullRect, 0, null, LayerCollection.NullRect);
                 if (layer == this.Default)
                 {
                     this.Default = layer1;
                 }
             }
         }
     }
 }
Ejemplo n.º 2
0
 public void Remove(DiagramLayer layer)
 {
     if (layer != null)
     {
         int num1 = this.IndexOf(layer);
         if (num1 >= 0)
         {
             if (layer.LayerCollectionContainer == this.LayerCollectionContainer)
             {
                 layer.Clear();
             }
             DiagramLayer layer1 = null;
             foreach (DiagramLayer layer2 in this.myLayers)
             {
                 if ((layer2 != layer) && (layer2.LayerCollectionContainer == this.LayerCollectionContainer))
                 {
                     layer1 = layer2;
                     break;
                 }
             }
             if (layer1 != null)
             {
                 DiagramLayer layer3 = null;
                 if ((num1 + 1) < this.myLayers.Count)
                 {
                     layer3 = (DiagramLayer)this.myLayers[num1 + 1];
                 }
                 this.myLayers.RemoveAt(num1);
                 this.LayerCollectionContainer.RaiseChanged(0x322, 0, layer, 0, layer3, LayerCollection.NullRect, 0, null, LayerCollection.NullRect);
                 if (layer == this.Default)
                 {
                     this.Default = layer1;
                 }
             }
         }
     }
 }