* ImageList.cs: When the image stream is set pull all the images
[mono.git] / mcs / class / Managed.Windows.Forms / System.Windows.Forms / PropertyGrid.cs
1 // Permission is hereby granted, free of charge, to any person obtaining
2 // a copy of this software and associated documentation files (the
3 // "Software"), to deal in the Software without restriction, including
4 // without limitation the rights to use, copy, modify, merge, publish,
5 // distribute, sublicense, and/or sell copies of the Software, and to
6 // permit persons to whom the Software is furnished to do so, subject to
7 // the following conditions:
8 //
9 // The above copyright notice and this permission notice shall be
10 // included in all copies or substantial portions of the Software.
11 //
12 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
13 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
14 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
15 // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
16 // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
17 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
18 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
19 //
20 // Copyright (c) 2004-2005 Novell, Inc.
21 //
22 // Authors:
23 //      Jonathan Chambers (jonathan.chambers@ansys.com)
24 //
25
26 // NOT COMPLETE
27
28 using System;
29 using System.Collections;
30 using System.ComponentModel;
31 using System.ComponentModel.Design;
32 using System.Drawing;
33 using System.Reflection;
34 using System.Windows.Forms.Design;
35 using System.Windows.Forms.PropertyGridInternal;
36
37 namespace System.Windows.Forms
38 {
39         [Designer("System.Windows.Forms.Design.PropertyGridDesigner, " + Consts.AssemblySystem_Design)]
40         public class PropertyGrid : System.Windows.Forms.ContainerControl, ComponentModel.Com2Interop.IComPropertyBrowser
41         {
42                 #region Private Members
43
44                 
45                 private const int GRID_ITEM_HEIGHT = 16;
46                 private const int GRID_LEFT_COLUMN_WIDTH = 16;
47                 private const int DIVIDER_PADDING = 2;
48
49                 private AttributeCollection browsable_attributes = null;
50                 private bool can_show_commands = false;
51                 private Color commands_back_color;
52                 private Color commands_fore_color;
53                 private bool commands_visible;
54                 private bool commands_visible_if_available;
55                 private Point context_menu_default_location;
56                 private bool large_buttons;
57                 private Color line_color;
58                 private PropertySort property_sort;
59                 private PropertyTabCollection property_tabs;
60                 private GridItem selected_grid_item;
61                 internal GridItemCollection grid_items;
62                 private object[] selected_objects;
63                 private PropertyTab selected_tab;
64
65                 private ImageList toolbar_imagelist;
66                 private ToolBarButton categorized_toolbarbutton;
67                 private ToolBarButton alphabetic_toolbarbutton;
68                 private ToolBarButton separator_toolbarbutton;
69                 private ToolBarButton propertypages_toolbarbutton;
70
71                 internal ToolBar toolbar;
72                 internal PropertyGridView property_grid_view;
73                 internal Splitter splitter;
74                 internal Panel help_panel;
75                 internal Label help_title_label;
76                 internal Label help_description_label;
77                 private ContextMenu context_menu;
78                 private MenuItem reset_menuitem;
79                 private MenuItem description_menuitem;
80
81
82                 #endregion      // Private Members
83
84                 #region Contructors
85                 public PropertyGrid()
86                 {
87                         line_color = SystemColors.ScrollBar;
88                         browsable_attributes = new AttributeCollection(new Attribute[] {});
89                         commands_visible_if_available = false;
90                         property_sort = PropertySort.CategorizedAlphabetical;
91
92                         property_grid_view = new PropertyGridView(this);
93                         property_grid_view.Dock = DockStyle.Fill;
94
95                         splitter = new Splitter();
96                         splitter.Dock = DockStyle.Bottom;
97
98                         help_panel = new Panel();
99                         help_panel.Dock = DockStyle.Bottom;
100                         help_panel.Height = 50;
101
102                         help_description_label = new Label();
103                         help_description_label.Dock = DockStyle.Fill;
104                         help_description_label.Name = "help_description_label";
105                         help_description_label.Font = this.Font;
106
107                         help_title_label = new Label();
108                         help_title_label.Dock = DockStyle.Top;
109                         help_title_label.Name = "help_title_label";
110                         help_description_label.Font = new Font(this.Font,FontStyle.Bold);
111
112                         help_panel.Controls.Add(help_description_label);
113                         help_panel.Controls.Add(help_title_label);
114
115                         toolbar = new ToolBar();
116                         toolbar.Dock = DockStyle.Top;
117                         categorized_toolbarbutton = new ToolBarButton();
118                         alphabetic_toolbarbutton = new ToolBarButton();
119                         separator_toolbarbutton = new ToolBarButton();
120                         propertypages_toolbarbutton = new ToolBarButton();
121                         context_menu = new ContextMenu();
122
123                         //help_title_label.Dock = DockStyle.Top;
124                         help_title_label.Name = "help_title_label";
125                         help_title_label.Location = new Point(2,20);
126                         help_title_label.Size = new Size(20,20);
127
128                         toolbar_imagelist = new ImageList();
129                         toolbar_imagelist.ColorDepth = ColorDepth.Depth32Bit;
130                         toolbar_imagelist.ImageSize = new System.Drawing.Size(16, 16);
131                         toolbar_imagelist.TransparentColor = System.Drawing.Color.Transparent;
132
133                         toolbar.Appearance = ToolBarAppearance.Flat;
134                         toolbar.AutoSize = false;
135                         toolbar.Buttons.AddRange(new ToolBarButton[] {
136                                 categorized_toolbarbutton,
137                                 alphabetic_toolbarbutton,
138                                 separator_toolbarbutton,
139                                 propertypages_toolbarbutton});
140
141                         toolbar.ButtonSize = new System.Drawing.Size(20, 20);
142                         toolbar.ImageList = toolbar_imagelist;
143                         toolbar.Location = new System.Drawing.Point(0, 0);
144                         toolbar.Name = "toolbar";
145                         toolbar.ShowToolTips = true;
146                         toolbar.Size = new System.Drawing.Size(256, 27);
147                         toolbar.TabIndex = 0;
148                         toolbar.ButtonClick += new ToolBarButtonClickEventHandler(toolbar_ButtonClick);
149
150                         categorized_toolbarbutton.Style = ToolBarButtonStyle.ToggleButton;
151                         categorized_toolbarbutton.ToolTipText = "Categorized";
152                         categorized_toolbarbutton.Text = "C";
153
154                         alphabetic_toolbarbutton.Style = ToolBarButtonStyle.ToggleButton;
155                         alphabetic_toolbarbutton.ToolTipText = "Alphabetic";
156                         alphabetic_toolbarbutton.Text = "A";
157
158                         separator_toolbarbutton.Style = ToolBarButtonStyle.Separator;
159
160                         propertypages_toolbarbutton.Enabled = false;
161                         propertypages_toolbarbutton.Style = ToolBarButtonStyle.ToggleButton;
162                         propertypages_toolbarbutton.ToolTipText = "Property Pages";
163                         propertypages_toolbarbutton.Text = "P";
164
165                         
166                         reset_menuitem = context_menu.MenuItems.Add("Reset");
167                         reset_menuitem.Click +=new EventHandler(OnResetPropertyClick);
168                         context_menu.MenuItems.Add("-");
169                         description_menuitem = context_menu.MenuItems.Add("Description");
170                         description_menuitem.Click += new EventHandler(OnDescriptionClick);
171                         description_menuitem.Checked = this.HelpVisible;
172                         this.ContextMenu = context_menu;
173                         toolbar.ContextMenu = context_menu;
174
175                         this.Controls.Add(property_grid_view);
176                         this.Controls.Add(toolbar);
177                         this.Controls.Add(splitter);
178                         this.Controls.Add(help_panel);
179                         this.Name = "PropertyGrid";
180                         this.Size = new System.Drawing.Size(256, 400);
181
182                         selected_objects = new object[1];
183                         grid_items = new GridItemCollection();
184
185                         has_focus = false;
186
187                         //TextChanged+=new System.EventHandler(RedrawEvent);
188                         //ForeColorChanged+=new EventHandler(RedrawEvent);
189                         //BackColorChanged+=new System.EventHandler(RedrawEvent);
190                         //FontChanged+=new EventHandler(RedrawEvent);
191                         //SizeChanged+=new EventHandler(RedrawEvent);
192
193                         
194                         SetStyle(ControlStyles.UserPaint, true);
195                         SetStyle(ControlStyles.AllPaintingInWmPaint, true);
196                         SetStyle(ControlStyles.ResizeRedraw, true);
197                         SetStyle(ControlStyles.StandardClick | ControlStyles.StandardDoubleClick, false);
198                 }
199                 #endregion      // Constructors
200
201                 #region Public Instance Properties
202
203                 [BrowsableAttribute(false)]
204                 [EditorBrowsableAttribute(EditorBrowsableState.Advanced)]
205                 [DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Hidden)]
206                 public AttributeCollection BrowsableAttributes
207                 {
208                         get {
209                                 return browsable_attributes;
210                         }
211
212                         set {
213                                 if (browsable_attributes == value) {
214                                         return;
215                                 }
216
217                                 browsable_attributes = value;
218                         }
219                 }
220
221                 public override Color BackColor
222                 {
223                         get {
224                                 return base.BackColor;
225                         }
226
227                         set {
228                                 if (base.BackColor == value) {
229                                         return;
230                                 }
231                                 base.BackColor = value;
232                         }
233                 }
234
235
236                 [BrowsableAttribute(false)]
237                 [EditorBrowsableAttribute(EditorBrowsableState.Advanced)]
238                 public virtual bool CanShowCommands 
239                 {
240                         get {
241                                 return can_show_commands;
242                         }
243                 }
244
245                 public Color CommandsBackColor 
246                 {
247                         get {
248                                 return commands_back_color;
249                         }
250
251                         set {
252                                 if (commands_back_color == value) {
253                                         return;
254                                 }
255                                 commands_back_color = value;
256                         }
257                 }
258
259                 public Color CommandsForeColor 
260                 {
261                         get {
262                                 return commands_fore_color;
263                         }
264
265                         set {
266                                 if (commands_fore_color == value) {
267                                         return;
268                                 }
269                                 commands_fore_color = value;
270                         }
271                 }
272
273                 [BrowsableAttribute(false)]
274                 [EditorBrowsableAttribute(EditorBrowsableState.Advanced)]
275                 public virtual bool CommandsVisible 
276                 {
277                         get {
278                                 return commands_visible;
279                         }
280                 }
281
282                 [DefaultValue(false)]
283                 public virtual bool CommandsVisibleIfAvailable 
284                 {
285                         get {
286                                 return commands_visible_if_available;
287                         }
288
289                         set {
290                                 if (commands_visible_if_available == value) {
291                                         return;
292                                 }
293                                 commands_visible_if_available = value;
294                         }
295                 }
296
297                 [BrowsableAttribute(false)]
298                 [EditorBrowsableAttribute(EditorBrowsableState.Advanced)]
299                 [DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Hidden)]
300                 public Point ContextMenuDefaultLocation
301                 {
302                         get {
303                                 return context_menu_default_location;
304                         }
305                 }
306
307                 public Color HelpBackColor
308                 {
309                         get
310                         {
311                                 return help_panel.BackColor;
312                         }
313
314                         set
315                         {
316                                 if (help_panel.BackColor == value) {
317                                         return;
318                                 }
319
320                                 help_panel.BackColor = value;
321                         }
322                 }
323
324                 public Color HelpForeColor
325                 {
326                         get {
327                                 return help_panel.ForeColor;
328                         }
329
330                         set {
331                                 if (help_panel.ForeColor == value) {
332                                         return;
333                                 }
334
335                                 help_panel.ForeColor = value;
336                         }
337                 }
338
339                 [DefaultValue(true)]
340                 [Localizable(true)]
341                 public virtual bool HelpVisible
342                 {
343                         get {
344                                 return help_panel.Visible;
345                         }
346
347                         set {
348                                 if (help_panel.Visible == value) {
349                                         return;
350                                 }
351
352                                 help_panel.Visible = value;
353                         }
354                 }
355
356                 public bool LargeButtons
357                 {
358                         get {
359                                 return large_buttons;
360                         }
361
362                         set {
363                                 if (large_buttons == value) {
364                                         return;
365                                 }
366
367                                 large_buttons = value;
368                         }
369                 }
370
371                 public Color LineColor
372                 {
373                         get {
374                                 return line_color;
375                         }
376
377                         set {
378                                 if (line_color == value) {
379                                         return;
380                                 }
381
382                                 line_color = value;
383                         }
384                 }
385
386                 [DefaultValue(PropertySort.CategorizedAlphabetical)]
387                 public PropertySort PropertySort
388                 {
389                         get {
390                                 return property_sort;
391                         }
392
393                         set {
394                                 if (!Enum.IsDefined (typeof (PropertySort), value)) {
395                                         throw new InvalidEnumArgumentException (string.Format("Enum argument value '{0}' is not valid for PropertySort", value));
396                                 }
397
398                                 if (property_sort == value) {
399                                         return;
400                                 }
401
402                                 property_sort = value;
403                         }
404                 }
405
406                 [BrowsableAttribute(false)]
407                 [EditorBrowsableAttribute(EditorBrowsableState.Advanced)]
408                 [DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Hidden)]
409                 public PropertyTabCollection PropertyTabs
410                 {
411                         get {
412                                 return property_tabs;
413                         }
414                 }
415
416                 [BrowsableAttribute(false)]
417                 [EditorBrowsableAttribute(EditorBrowsableState.Advanced)]
418                 [DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Hidden)]
419                 public GridItem SelectedGridItem
420                 {
421                         get {
422                                 return selected_grid_item;
423                         }
424
425                         set {
426                                 if (selected_grid_item == value) {
427                                         return;
428                                 }
429
430                                 selected_grid_item = value;
431                                 this.help_title_label.Text = selected_grid_item.PropertyDescriptor.Name;
432                                 this.help_description_label.Text = selected_grid_item.PropertyDescriptor.Description;
433                                 property_grid_view.Redraw();
434                 
435                         }
436                 }
437
438                 [DefaultValue(null)]
439                 [TypeConverter("System.Windows.Forms.PropertyGrid+SelectedObjectConverter, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089")]
440                 public object SelectedObject
441                 {
442                         get {
443                                 return selected_objects[0];
444                         }
445
446                         set {
447                                 selected_objects = new object[] {value};
448                                 ReflectObjects();
449                                 property_grid_view.Redraw();
450                         }
451                 }
452
453                 [BrowsableAttribute(false)]
454                 [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
455                 public object[] SelectedObjects
456                 {
457                         get {
458                                 return selected_objects;
459                         }
460
461                         set {
462                                 selected_objects = value;
463                                 ReflectObjects();
464                         }
465                 }
466
467                 [BrowsableAttribute(false)]
468                 [EditorBrowsable(EditorBrowsableState.Advanced)]
469                 [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
470                 public PropertyTab SelectedTab
471                 {
472                         get {
473                                 return selected_tab;
474                         }
475                 }
476
477                 public override ISite Site
478                 {
479                         get {
480                                 return base.Site;
481                         }
482
483                         set {
484                                 base.Site = value;
485                         }
486                 }
487
488
489                 [DefaultValue(true)]
490                 public virtual bool ToolbarVisible 
491                 {
492                         get {
493                                 return toolbar.Visible;
494                         }
495
496                         set {
497                                 if (toolbar.Visible == value) {
498                                         return;
499                                 }
500
501                                 toolbar.Visible = value;
502                         }
503                 }
504
505                 public Color ViewBackColor
506                 {
507                         get {
508                                 return property_grid_view.BackColor;
509                         }
510
511                         set {
512                                 if (property_grid_view.BackColor == value) {
513                                         return;
514                                 }
515
516                                 property_grid_view.BackColor = value;
517                         }
518                 }
519
520                 public Color ViewForeColor
521                 {
522                         get {
523                                 return property_grid_view.ForeColor;
524                         }
525
526                         set {
527                                 if (property_grid_view.ForeColor == value) {
528                                         return;
529                                 }
530
531                                 property_grid_view.ForeColor = value;
532                         }
533                 }
534
535                 #endregion      // Public Instance Properties
536
537                 #region Protected Instance Properties
538
539                 protected override Size DefaultSize
540                 {
541                         get {
542                                 return base.DefaultSize;
543                         }
544                 }
545
546
547                 [MonoTODO]
548                 [Browsable(false)]
549                 [EditorBrowsable(EditorBrowsableState.Advanced)]
550                 protected virtual Type DefaultTabType 
551                 {
552                         get {
553                                 throw new NotImplementedException();
554                         }
555                 }
556
557                 protected override bool ShowFocusCues
558                 {
559                         get {
560                                 return base.ShowFocusCues;
561                         }
562                 }
563
564                 #endregion      // Protected Instance Properties
565
566                 #region Public Instance Methods
567                 [MonoTODO]
568                 public void CollapseAllGridItems()
569                 {
570                         throw new NotImplementedException();
571                 }
572
573                 [MonoTODO]
574                 public void ExpandAllGridItems()
575                 {
576                         throw new NotImplementedException();
577                 }
578
579                 public override void Refresh()
580                 {
581                         base.Refresh ();
582                 }
583
584
585                 [MonoTODO]
586                 public void RefreshTabs(PropertyTabScope tabScope)
587                 {
588                         throw new NotImplementedException();
589                 }
590
591                 [MonoTODO]
592                 public void ResetSelectedProperty()
593                 {
594                         throw new NotImplementedException();
595                 }
596                 #endregion      // Public Instance Methods
597
598                 #region Protected Instance Methods
599                 [MonoTODO]
600                 protected virtual PropertyTab CreatePropertyTab(Type tabType)
601                 {
602                         throw new NotImplementedException();
603                 }
604
605                 protected override void OnFontChanged(EventArgs e)
606                 {
607                         base.OnFontChanged (e);
608                 }
609
610                 protected override void OnGotFocus(EventArgs e) 
611                 {
612                         base.OnGotFocus(e);
613                 }
614
615                 protected override void OnHandleCreated(EventArgs e)
616                 {
617                         base.OnHandleCreated (e);
618                 }
619
620                 protected override void OnHandleDestroyed(EventArgs e)
621                 {
622                         base.OnHandleDestroyed (e);
623                 }
624
625
626                 protected override void OnMouseDown(MouseEventArgs e)
627                 {
628                         base.OnMouseDown (e);
629                 }
630
631                 protected override void OnMouseMove(MouseEventArgs e)
632                 {
633                         base.OnMouseMove (e);
634                 }
635
636                 protected override void OnMouseUp(MouseEventArgs e)
637                 {
638                         base.OnMouseUp (e);
639                 }
640
641                 protected override void OnPaint(PaintEventArgs pevent)
642                 {
643                         base.OnPaint (pevent);
644                 }
645
646                 [MonoTODO]
647                 protected virtual void OnPropertyTabChanged(PropertyTabChangedEventArgs e)
648                 {
649                         throw new NotImplementedException();
650                 }
651
652                 [MonoTODO]
653                 protected virtual void OnPropertyValueChanged(PropertyValueChangedEventArgs e)
654                 {
655                         throw new NotImplementedException();
656                 }
657
658                 protected override void OnResize(EventArgs e)
659                 {
660                         base.OnResize (e);
661                 }
662
663                 [MonoTODO]
664                 protected virtual void OnSelectedGridItemChanged(SelectedGridItemChangedEventArgs e)
665                 {
666                         throw new NotImplementedException();
667                 }
668
669                 [MonoTODO]
670                 protected virtual void OnSelectedObjectsChanged(EventArgs e)
671                 {
672                         throw new NotImplementedException();
673                 }
674
675                 protected override void OnSystemColorsChanged(EventArgs e)
676                 {
677                         base.OnSystemColorsChanged (e);
678                 }
679
680                 protected override void OnVisibleChanged(EventArgs e)
681                 {
682                         base.OnVisibleChanged (e);
683                 }
684
685                 protected override bool ProcessDialogKey(Keys keyData)
686                 {
687                         return base.ProcessDialogKey (keyData);
688                 }
689
690                 protected override void ScaleCore(float dx, float dy)
691                 {
692                         base.ScaleCore (dx, dy);
693                 }
694
695                 protected override void WndProc(ref Message m)
696                 {
697                         base.WndProc (ref m);
698                 }
699                 #endregion
700
701                 #region Events
702                 public event EventHandler PropertySortChanged;
703                 public event PropertyTabChangedEventHandler PropertyTabChanged;
704                 public event PropertyValueChangedEventHandler PropertyValueChanged;
705                 public event SelectedGridItemChangedEventHandler SelectedGridItemChanged;
706                 public event EventHandler SelectedObjectsChanged;
707                 #endregion
708
709                 #region Com2Interop.IComPropertyBrowser Interface
710                 [MonoTODO]
711                 bool ComponentModel.Com2Interop.IComPropertyBrowser.InPropertySet {
712                         get  {
713                                 throw new NotImplementedException();
714                         }
715                 }
716
717                 [MonoTODO]
718                 void ComponentModel.Com2Interop.IComPropertyBrowser.DropDownDone() {
719                         throw new NotImplementedException();
720                 }
721
722                 [MonoTODO]
723                 bool ComponentModel.Com2Interop.IComPropertyBrowser.EnsurePendingChangesCommitted() {
724                         throw new NotImplementedException();
725                 }
726
727                 [MonoTODO]
728                 void ComponentModel.Com2Interop.IComPropertyBrowser.HandleF4() {
729                         throw new NotImplementedException();
730                 }
731
732                 [MonoTODO]
733                 void ComponentModel.Com2Interop.IComPropertyBrowser.LoadState(Microsoft.Win32.RegistryKey key) {
734                         throw new NotImplementedException();
735                 }
736
737                 [MonoTODO]
738                 void ComponentModel.Com2Interop.IComPropertyBrowser.SaveState(Microsoft.Win32.RegistryKey key) {
739                         throw new NotImplementedException();
740                 }
741
742                 [MonoTODO]
743                 private event ComponentRenameEventHandler com_component_name_changed;
744                 event ComponentRenameEventHandler ComponentModel.Com2Interop.IComPropertyBrowser.ComComponentNameChanged {
745                         add { com_component_name_changed += value; }
746                         remove { com_component_name_changed -= value; }
747                 }
748                 #endregion      // Com2Interop.IComPropertyBrowser Interface
749
750                 #region PropertyTabCollection Class
751                 public class PropertyTabCollection : ICollection, IEnumerable
752                 {
753                         #region Private Constructors
754                         private PropertyTabCollection() {
755                         }
756
757                         #endregion      // Private Constructors
758
759                         [MonoTODO]
760                         public PropertyTab this[int index]
761                         {
762                                 get {
763                                         throw new NotImplementedException();
764                                 }
765                         }
766                 
767                         #region ICollection Members
768                         [MonoTODO]
769                         bool ICollection.IsSynchronized
770                         {
771                                 get {
772                                         // TODO:  Add PropertyTabCollection.IsSynchronized getter implementation
773                                         return false;
774                                 }
775                         }
776
777                         [MonoTODO]
778                         void ICollection.CopyTo(Array array, int index)
779                         {
780                                 // TODO:  Add PropertyTabCollection.CopyTo implementation
781                         }
782
783                         [MonoTODO]
784                         object ICollection.SyncRoot
785                         {
786                                 get {
787                                         // TODO:  Add PropertyTabCollection.SyncRoot getter implementation
788                                         return null;
789                                 }
790                         }
791
792                         #endregion
793
794                         #region IEnumerable Members
795                         [MonoTODO]
796                         public IEnumerator GetEnumerator()
797                         {
798                                 // TODO:  Add PropertyTabCollection.GetEnumerator implementation
799                                 return null;
800                         }
801
802                         #endregion
803                 
804                         #region ICollection Members
805                         [MonoTODO]
806                         public int Count
807                         {
808                                 get {
809                                         // TODO:  Add PropertyTabCollection.Count getter implementation
810                                         return 0;
811                                 }
812                         }
813
814                         #endregion
815                 }
816                 #endregion      // PropertyTabCollection Class
817
818
819                 #region Private Helper Methods
820
821                 private void toolbar_ButtonClick(object sender, ToolBarButtonClickEventArgs e)
822                 {
823                         if (e.Button == alphabetic_toolbarbutton) {
824                                 this.PropertySort = PropertySort.Alphabetical;
825                         } else if (e.Button == categorized_toolbarbutton) {
826                                 this.PropertySort = PropertySort.Categorized;
827                         }
828                 }
829
830                 internal void UpdateToolBarButtons()
831                 {
832                         if (PropertySort == PropertySort.Alphabetical) {
833                                 categorized_toolbarbutton.Pushed = false;
834                                 alphabetic_toolbarbutton.Pushed = true;
835                         } else if (PropertySort == PropertySort.Categorized) {
836                                 categorized_toolbarbutton.Pushed = true;
837                                 alphabetic_toolbarbutton.Pushed = false;
838                         } else {
839                                 categorized_toolbarbutton.Pushed = false;
840                                 alphabetic_toolbarbutton.Pushed = false;
841                         }
842                 }
843
844                 private void OnResetPropertyClick(object sender, EventArgs e)
845                 {
846                         ResetSelectedProperty();
847                 }
848
849                 private void OnDescriptionClick(object sender, EventArgs e)
850                 {
851                         this.HelpVisible = !this.HelpVisible;
852                         description_menuitem.Checked = this.HelpVisible;
853
854                 }
855
856                 private void ReflectObjects()
857                 {
858                         grid_items = new GridItemCollection();
859                         foreach (object obj in selected_objects) {
860                                 if (obj != null) {
861                                         PopulateGridItemCollection(obj,grid_items);
862                                 }
863                         }
864                 }
865
866                 private void PopulateGridItemCollection(object obj, GridItemCollection grid_item_coll)
867                 {
868                         PropertyDescriptorCollection properties = TypeDescriptor.GetProperties(obj);
869                         for (int i = 0; i < properties.Count;i++) {
870                                 bool not_browseable = properties[i].Attributes.Contains(new Attribute[] {new BrowsableAttribute(false)});
871                                 if (!not_browseable) {
872                                         GridEntry grid_entry = new GridEntry(obj, properties[i]);
873                                         //object test = grid_item_coll["Length"];
874                                         grid_item_coll.Add(properties[i].Name,grid_entry);
875                                         //PopulateGridItemCollection(grid_entry.Value,grid_entry.GridItems);
876                                 }
877                         }
878                 }
879                 #endregion      // Private Helper Methods
880         }
881 }