Example #1
0
 void IToolboxService.RemoveCreator(string format, IDesignerHost host)
 {
     if (format == null)
     {
         throw new ArgumentNullException("format");
     }
     if (host == null)
     {
         throw new ArgumentNullException("host");
     }
     if (this._designerCreators != null)
     {
         ArrayList list = this._designerCreators[host] as ArrayList;
         if (list != null)
         {
             for (int i = 0; i < list.Count; i++)
             {
                 ToolboxItemCreator creator = list[i] as ToolboxItemCreator;
                 if (creator.Format.Equals(format))
                 {
                     list.RemoveAt(i);
                     this._lastMergedHost     = null;
                     this._lastMergedCreators = null;
                     return;
                 }
             }
         }
     }
 }
Example #2
0
 private ICollection GetCreatorCollection(IDesignerHost host)
 {
     if (host == null)
     {
         return(this._globalCreators);
     }
     if (host != this._lastMergedHost)
     {
         ICollection is2 = this._globalCreators;
         ICollection is3 = null;
         if (this._designerCreators != null)
         {
             is3 = this._designerCreators[host] as ICollection;
             if (is3 != null)
             {
                 int count = is3.Count;
                 if (is2 != null)
                 {
                     count += is2.Count;
                 }
                 ToolboxItemCreator[] array = new ToolboxItemCreator[count];
                 is3.CopyTo(array, 0);
                 if (is2 != null)
                 {
                     is2.CopyTo(array, is3.Count);
                 }
                 is2 = array;
             }
         }
         this._lastMergedCreators = is2;
         this._lastMergedHost     = host;
     }
     return(this._lastMergedCreators);
 }
Example #3
0
 void IToolboxService.RemoveCreator(string format)
 {
     if (format == null)
     {
         throw new ArgumentNullException("format");
     }
     if (this._globalCreators != null)
     {
         for (int i = 0; i < this._globalCreators.Count; i++)
         {
             ToolboxItemCreator creator = this._globalCreators[i] as ToolboxItemCreator;
             if (creator.Format.Equals(format))
             {
                 this._globalCreators.RemoveAt(i);
                 this._lastMergedHost     = null;
                 this._lastMergedCreators = null;
                 return;
             }
         }
     }
 }