Ejemplo n.º 1
0
 private void OnToolboxSectionItemsChanged(object sender, EventArgs e)
 {
     for (int i = 0; i < this._sections.Count; i++)
     {
         SectionInfo info = (SectionInfo) this._sections[i];
         if (info.ToolboxSection == sender)
         {
             this._groupView.BeginUpdate();
             try
             {
                 ((IList) info.UISection.Items).Clear();
                 foreach (ToolboxDataItem item in info.ToolboxSection.ToolboxDataItems)
                 {
                     ToolboxDataGroupViewItem item2 = new ToolboxDataGroupViewItem(item, this);
                     info.UISection.Items.Add(item2);
                 }
             }
             finally
             {
                 this._groupView.EndUpdate();
             }
         }
     }
 }
Ejemplo n.º 2
0
 private void OnSectionAdded(object sender, ToolboxSectionEventArgs e)
 {
     ToolboxSection section = e.Section;
     this._groupViewImages.Images.Add(section.Icon);
     GroupViewSection section2 = new GroupViewSection();
     section2.ImageIndex = this._groupViewImages.Images.Count - 1;
     section2.Text = section.Name;
     section2.Visible = false;
     foreach (ToolboxDataItem item in section.ToolboxDataItems)
     {
         ToolboxDataGroupViewItem item2 = new ToolboxDataGroupViewItem(item, this);
         section2.Items.Add(item2);
     }
     SectionInfo info = new SectionInfo();
     info.ToolboxSection = section;
     info.UISection = section2;
     this._sections.Add(info);
     this._groupView.Sections.Add(section2);
     section.ItemsChanged += new EventHandler(this.OnToolboxSectionItemsChanged);
     this.UpdateToolboxClient();
 }