예제 #1
0
 public PropertyPad()
 {
     instance                          = this;
     this.panel                        = new Panel();
     this.grid                         = new PropertyGrid();
     this.grid.PropertySort            = PropertySort.CategorizedAlphabetical;
     this.grid.Dock                    = DockStyle.Fill;
     this.grid.SelectedObjectsChanged += delegate(object sender, EventArgs e) {
         if (SelectedObjectChanged != null)
         {
             SelectedObjectChanged(sender, e);
         }
     };
     this.grid.SelectedGridItemChanged += delegate(object sender, SelectedGridItemChangedEventArgs e) {
         if (SelectedGridItemChanged != null)
         {
             SelectedGridItemChanged(sender, e);
         }
     };
     this.comboBox                       = new ComboBox();
     this.comboBox.Dock                  = DockStyle.Top;
     this.comboBox.DropDownStyle         = ComboBoxStyle.DropDownList;
     this.comboBox.DrawMode              = DrawMode.OwnerDrawFixed;
     this.comboBox.Sorted                = true;
     this.comboBox.DrawItem             += new DrawItemEventHandler(this.ComboBoxDrawItem);
     this.comboBox.MeasureItem          += new MeasureItemEventHandler(this.ComboBoxMeasureItem);
     this.comboBox.SelectedIndexChanged += new EventHandler(this.ComboBoxSelectedIndexChanged);
     this.panel.Controls.Add(this.grid);
     this.panel.Controls.Add(this.comboBox);
     this.grid.PropertyValueChanged += new PropertyValueChangedEventHandler(this.PropertyChanged);
     //LoggingService.Debug("PropertyPad created");
     WorkbenchSingleton.Workbench.ActiveWorkbenchWindowChanged += new EventHandler(this.WorkbenchWindowChanged);
     this.WorkbenchWindowChanged(null, null);
 }
예제 #2
0
 public override void Dispose()
 {
     base.Dispose();
     if (this.grid != null)
     {
         try
         {
             this.grid.SelectedObjects = null;
         }
         catch
         {
         }
         this.grid.Dispose();
         this.grid = null;
         instance  = null;
     }
 }