[LoongArch64] Part-5:add loongarch support in some files for LoongArch64. (#21769)
[mono-project.git] / mcs / class / System.Windows.Forms / System.Windows.Forms / DataGridTableStyle.cs
blob8166e26cd6df2b58ff24d5e7f3222ba4a7ef67d6
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.
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.
20 // Copyright (c) 2004-2005 Novell, Inc.
22 // Authors:
24 // Peter Bartok <pbartok@novell.com>
25 // Jordi Mas i Hernandez <jordi@ximian.com>
28 // NOT COMPLETE
31 using System.Collections;
32 using System.ComponentModel;
33 using System.Drawing;
34 using System.Runtime.InteropServices;
35 using System.Data;
36 using System.Xml;
37 using System.Runtime.Serialization;
39 namespace System.Windows.Forms
41 [DesignTimeVisible(false)]
42 [ToolboxItem(false)]
43 public class DataGridTableStyle : Component, IDataGridEditingService
45 readonly
46 public static DataGridTableStyle DefaultTableStyle = new DataGridTableStyle (true);
48 #region Local Variables
49 private static readonly Color def_alternating_backcolor = ThemeEngine.Current.DataGridAlternatingBackColor;
50 private static readonly Color def_backcolor = ThemeEngine.Current.DataGridBackColor;
51 private static readonly Color def_forecolor = SystemColors.WindowText;
52 private static readonly Color def_gridline_color = ThemeEngine.Current.DataGridGridLineColor;
53 private static readonly Color def_header_backcolor = ThemeEngine.Current.DataGridHeaderBackColor;
54 private static readonly Font def_header_font = ThemeEngine.Current.DefaultFont;
55 private static readonly Color def_header_forecolor = ThemeEngine.Current.DataGridHeaderForeColor;
56 private static readonly Color def_link_color = ThemeEngine.Current.DataGridLinkColor;
57 private static readonly Color def_link_hovercolor = ThemeEngine.Current.DataGridLinkHoverColor;
58 private static readonly Color def_selection_backcolor = ThemeEngine.Current.DataGridSelectionBackColor;
59 private static readonly Color def_selection_forecolor = ThemeEngine.Current.DataGridSelectionForeColor;
60 private static readonly int def_preferredrow_height = ThemeEngine.Current.DefaultFont.Height + 3;
62 private bool allow_sorting;
63 private DataGrid datagrid;
64 private Color header_forecolor;
65 private string mapping_name;
66 private Color alternating_backcolor;
67 private bool columnheaders_visible;
68 private GridColumnStylesCollection column_styles;
69 private Color gridline_color;
70 private DataGridLineStyle gridline_style;
71 private Color header_backcolor;
72 private Font header_font;
73 private Color link_color;
74 private Color link_hovercolor;
75 private int preferredcolumn_width;
76 private int preferredrow_height;
77 private bool _readonly;
78 private bool rowheaders_visible;
79 private Color selection_backcolor;
80 private Color selection_forecolor;
81 private int rowheaders_width;
82 private Color backcolor;
83 private Color forecolor;
84 private bool is_default;
85 internal ArrayList table_relations;
86 CurrencyManager manager;
87 #endregion // Local Variables
89 #region Constructors
90 public DataGridTableStyle ()
91 : this (false)
95 public DataGridTableStyle (bool isDefaultTableStyle)
97 is_default = isDefaultTableStyle;
98 allow_sorting = true;
99 datagrid = null;
100 header_forecolor = def_header_forecolor;
101 mapping_name = string.Empty;
102 table_relations = new ArrayList ();
103 column_styles = new GridColumnStylesCollection (this);
105 alternating_backcolor = def_alternating_backcolor;
106 columnheaders_visible = true;
107 gridline_color = def_gridline_color;
108 gridline_style = DataGridLineStyle.Solid;
109 header_backcolor = def_header_backcolor;
110 header_font = null;
111 link_color = def_link_color;
112 link_hovercolor = def_link_hovercolor;
113 preferredcolumn_width = ThemeEngine.Current.DataGridPreferredColumnWidth;
114 preferredrow_height = ThemeEngine.Current.DefaultFont.Height + 3;
115 _readonly = false;
116 rowheaders_visible = true;
117 selection_backcolor = def_selection_backcolor;
118 selection_forecolor = def_selection_forecolor;
119 rowheaders_width = 35;
120 backcolor = def_backcolor;
121 forecolor = def_forecolor;
124 public DataGridTableStyle (CurrencyManager listManager)
125 : this (false)
127 manager = listManager;
129 #endregion
131 #region Public Instance Properties
132 [DefaultValue(true)]
133 public bool AllowSorting {
134 get { return allow_sorting; }
135 set {
136 if (is_default)
137 throw new ArgumentException ("Cannot change the value of this property on the default DataGridTableStyle.");
139 if (allow_sorting != value) {
140 allow_sorting = value;
141 OnAllowSortingChanged (EventArgs.Empty);
146 public Color AlternatingBackColor {
147 get { return alternating_backcolor; }
148 set {
149 if (is_default)
150 throw new ArgumentException ("Cannot change the value of this property on the default DataGridTableStyle.");
152 if (alternating_backcolor != value) {
153 alternating_backcolor = value;
154 OnAlternatingBackColorChanged (EventArgs.Empty);
159 public Color BackColor {
160 get { return backcolor; }
161 set {
162 if (is_default)
163 throw new ArgumentException ("Cannot change the value of this property on the default DataGridTableStyle.");
165 if (backcolor != value) {
166 backcolor = value;
167 // XXX This should be OnBackColorChanged, MS made a c&p error, I think
168 OnForeColorChanged (EventArgs.Empty);
173 [DefaultValue(true)]
174 public bool ColumnHeadersVisible {
175 get {
176 return columnheaders_visible;
179 set {
180 if (columnheaders_visible != value) {
181 columnheaders_visible = value;
182 OnColumnHeadersVisibleChanged (EventArgs.Empty);
187 [Browsable(false)]
188 public virtual DataGrid DataGrid {
189 get { return datagrid; }
190 set {
191 if (datagrid != value) {
192 datagrid = value;
194 /* now set the value on all our column styles */
195 for (int i = 0; i < column_styles.Count; i ++) {
196 column_styles[i].SetDataGridInternal (datagrid);
202 public Color ForeColor {
203 get { return forecolor; }
204 set {
205 if (is_default)
206 throw new ArgumentException ("Cannot change the value of this property on the default DataGridTableStyle.");
208 if (forecolor != value) {
209 forecolor = value;
210 // XXX This should be OnForeColorChanged, MS made a c&p error, I think
211 OnBackColorChanged (EventArgs.Empty);
216 [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
217 [Localizable(true)]
218 public virtual GridColumnStylesCollection GridColumnStyles {
219 get { return column_styles; }
222 public Color GridLineColor {
223 get { return gridline_color; }
224 set {
225 if (is_default)
226 throw new ArgumentException ("Cannot change the value of this property on the default DataGridTableStyle.");
228 if (gridline_color != value) {
229 gridline_color = value;
230 OnGridLineColorChanged (EventArgs.Empty);
235 [DefaultValue(DataGridLineStyle.Solid)]
236 public DataGridLineStyle GridLineStyle {
237 get { return gridline_style; }
238 set {
239 if (is_default)
240 throw new ArgumentException ("Cannot change the value of this property on the default DataGridTableStyle.");
242 if (gridline_style != value) {
243 gridline_style = value;
244 OnGridLineStyleChanged (EventArgs.Empty);
249 public Color HeaderBackColor {
250 get { return header_backcolor; }
251 set {
252 if (is_default)
253 throw new ArgumentException ("Cannot change the value of this property on the default DataGridTableStyle.");
255 if (value == Color.Empty) {
256 throw new ArgumentNullException ("Color.Empty value is invalid.");
259 if (header_backcolor != value) {
260 header_backcolor = value;
261 OnHeaderBackColorChanged (EventArgs.Empty);
266 [AmbientValue(null)]
267 [Localizable(true)]
268 public Font HeaderFont {
269 get {
270 if (header_font != null)
271 return header_font;
273 if (DataGrid != null)
274 return DataGrid.Font;
276 return def_header_font;
278 set {
279 if (is_default)
280 throw new ArgumentException ("Cannot change the value of this property on the default DataGridTableStyle.");
282 if (header_font != value) {
283 header_font = value;
284 OnHeaderFontChanged (EventArgs.Empty);
289 public Color HeaderForeColor {
290 get { return header_forecolor; }
291 set {
292 if (is_default)
293 throw new ArgumentException ("Cannot change the value of this property on the default DataGridTableStyle.");
295 if (header_forecolor != value) {
296 header_forecolor = value;
297 OnHeaderForeColorChanged (EventArgs.Empty);
302 public Color LinkColor {
303 get { return link_color; }
304 set {
305 if (is_default)
306 throw new ArgumentException ("Cannot change the value of this property on the default DataGridTableStyle.");
308 if (link_color != value) {
309 link_color = value;
310 OnLinkColorChanged (EventArgs.Empty);
316 [EditorBrowsable(EditorBrowsableState.Never)]
317 [Browsable(false)]
318 public Color LinkHoverColor {
319 get { return link_hovercolor; }
320 set {
321 if (link_hovercolor != value) {
322 link_hovercolor = value;
323 // XXX MS doesn't emit this event (even though they should...)
324 // OnLinkHoverColorChanged (EventArgs.Empty);
329 [Editor("System.Windows.Forms.Design.DataGridTableStyleMappingNameEditor, " + Consts.AssemblySystem_Design, typeof(System.Drawing.Design.UITypeEditor))]
330 [DefaultValue ("")]
331 public string MappingName {
332 get { return mapping_name; }
333 set {
334 if (value == null)
335 value = "";
337 if (mapping_name != value) {
338 mapping_name = value;
339 OnMappingNameChanged (EventArgs.Empty);
344 [DefaultValue(75)]
345 [TypeConverter(typeof(DataGridPreferredColumnWidthTypeConverter))]
346 [Localizable(true)]
347 public int PreferredColumnWidth {
348 get { return preferredcolumn_width; }
349 set {
350 if (is_default)
351 throw new ArgumentException ("Cannot change the value of this property on the default DataGridTableStyle.");
353 if (value < 0) {
354 throw new ArgumentException ("PreferredColumnWidth is less than 0");
357 if (preferredcolumn_width != value) {
358 preferredcolumn_width = value;
359 OnPreferredColumnWidthChanged (EventArgs.Empty);
364 [Localizable(true)]
365 public int PreferredRowHeight {
366 get { return preferredrow_height; }
367 set {
368 if (is_default)
369 throw new ArgumentException ("Cannot change the value of this property on the default DataGridTableStyle.");
371 if (preferredrow_height != value) {
372 preferredrow_height = value;
373 OnPreferredRowHeightChanged (EventArgs.Empty);
378 [DefaultValue(false)]
379 public virtual bool ReadOnly {
380 get { return _readonly; }
381 set {
382 if (_readonly != value) {
383 _readonly = value;
384 OnReadOnlyChanged (EventArgs.Empty);
389 [DefaultValue(true)]
390 public bool RowHeadersVisible {
391 get { return rowheaders_visible; }
392 set {
393 if (rowheaders_visible != value) {
394 rowheaders_visible = value;
395 OnRowHeadersVisibleChanged (EventArgs.Empty);
400 [DefaultValue(35)]
401 [Localizable(true)]
402 public int RowHeaderWidth {
403 get { return rowheaders_width; }
404 set {
405 if (rowheaders_width != value) {
406 rowheaders_width = value;
407 OnRowHeaderWidthChanged (EventArgs.Empty);
412 public Color SelectionBackColor {
413 get { return selection_backcolor; }
414 set {
415 if (is_default)
416 throw new ArgumentException ("Cannot change the value of this property on the default DataGridTableStyle.");
418 if (selection_backcolor != value) {
419 selection_backcolor = value;
420 OnSelectionBackColorChanged (EventArgs.Empty);
425 [Description("The foreground color for the current data grid row")]
426 public Color SelectionForeColor {
427 get { return selection_forecolor; }
428 set {
429 if (is_default)
430 throw new ArgumentException ("Cannot change the value of this property on the default DataGridTableStyle.");
432 if (selection_forecolor != value) {
433 selection_forecolor = value;
434 OnSelectionForeColorChanged (EventArgs.Empty);
439 #endregion // Public Instance Properties
441 #region Private Instance Properties
442 internal DataGridLineStyle CurrentGridLineStyle {
443 get {
444 if (is_default && datagrid != null) {
445 return datagrid.GridLineStyle;
448 return gridline_style;
452 internal Color CurrentGridLineColor {
453 get {
454 if (is_default && datagrid != null) {
455 return datagrid.GridLineColor;
458 return gridline_color;
462 internal Color CurrentHeaderBackColor {
463 get {
464 if (is_default && datagrid != null) {
465 return datagrid.HeaderBackColor;
468 return header_backcolor;
472 internal Color CurrentHeaderForeColor {
473 get {
474 if (is_default && datagrid != null) {
475 return datagrid.HeaderForeColor;
478 return header_forecolor;
482 internal int CurrentPreferredColumnWidth {
483 get {
484 if (is_default && datagrid != null) {
485 return datagrid.PreferredColumnWidth;
488 return preferredcolumn_width;
492 internal int CurrentPreferredRowHeight {
493 get {
494 if (is_default && datagrid != null) {
495 return datagrid.PreferredRowHeight;
498 return preferredrow_height;
502 internal bool CurrentRowHeadersVisible {
503 get {
504 if (is_default && datagrid != null) {
505 return datagrid.RowHeadersVisible;
508 return rowheaders_visible;
512 internal bool HasRelations {
513 get { return table_relations.Count > 0; }
516 internal string[] Relations {
517 get {
518 string[] rel = new string[table_relations.Count];
519 table_relations.CopyTo (rel, 0);
520 return rel;
524 #endregion Private Instance Properties
526 #region Public Instance Methods
528 [MonoTODO ("Not implemented, will throw NotImplementedException")]
529 public bool BeginEdit (DataGridColumnStyle gridColumn, int rowNumber)
531 throw new NotImplementedException ();
534 protected internal virtual DataGridColumnStyle CreateGridColumn (PropertyDescriptor prop)
536 return CreateGridColumn (prop, false);
539 protected internal virtual DataGridColumnStyle CreateGridColumn (PropertyDescriptor prop, bool isDefault)
541 if (prop.PropertyType == typeof (bool))
542 return new DataGridBoolColumn (prop, isDefault);
543 else {
544 // At least to special cases with formats
545 if (prop.PropertyType.Equals (typeof (DateTime))) {
546 return new DataGridTextBoxColumn (prop, "d", isDefault);
549 if (prop.PropertyType.Equals (typeof (Int32)) ||
550 prop.PropertyType.Equals (typeof (Int16))) {
551 return new DataGridTextBoxColumn (prop, "G", isDefault);
554 return new DataGridTextBoxColumn (prop, isDefault);
558 protected override void Dispose (bool disposing)
560 base.Dispose (disposing);
563 [MonoTODO ("Not implemented, will throw NotImplementedException")]
564 public bool EndEdit (DataGridColumnStyle gridColumn, int rowNumber, bool shouldAbort)
566 throw new NotImplementedException ();
569 protected virtual void OnAllowSortingChanged (EventArgs e)
571 EventHandler eh = (EventHandler)(Events [AllowSortingChangedEvent]);
572 if (eh != null)
573 eh (this, e);
576 protected virtual void OnAlternatingBackColorChanged (EventArgs e)
578 EventHandler eh = (EventHandler)(Events [AlternatingBackColorChangedEvent]);
579 if (eh != null)
580 eh (this, e);
583 protected virtual void OnBackColorChanged (EventArgs e)
585 EventHandler eh = (EventHandler)(Events [BackColorChangedEvent]);
586 if (eh != null)
587 eh (this, e);
590 protected virtual void OnColumnHeadersVisibleChanged (EventArgs e)
592 EventHandler eh = (EventHandler)(Events [ColumnHeadersVisibleChangedEvent]);
593 if (eh != null)
594 eh (this, e);
597 protected virtual void OnForeColorChanged (EventArgs e)
599 EventHandler eh = (EventHandler)(Events [ForeColorChangedEvent]);
600 if (eh != null)
601 eh (this, e);
604 protected virtual void OnGridLineColorChanged (EventArgs e)
606 EventHandler eh = (EventHandler)(Events [GridLineColorChangedEvent]);
607 if (eh != null)
608 eh (this, e);
611 protected virtual void OnGridLineStyleChanged (EventArgs e)
613 EventHandler eh = (EventHandler)(Events [GridLineStyleChangedEvent]);
614 if (eh != null)
615 eh (this, e);
618 protected virtual void OnHeaderBackColorChanged (EventArgs e)
620 EventHandler eh = (EventHandler)(Events [HeaderBackColorChangedEvent]);
621 if (eh != null)
622 eh (this, e);
625 protected virtual void OnHeaderFontChanged (EventArgs e)
627 EventHandler eh = (EventHandler)(Events [HeaderFontChangedEvent]);
628 if (eh != null)
629 eh (this, e);
632 protected virtual void OnHeaderForeColorChanged (EventArgs e)
634 EventHandler eh = (EventHandler)(Events [HeaderForeColorChangedEvent]);
635 if (eh != null)
636 eh (this, e);
639 protected virtual void OnLinkColorChanged (EventArgs e)
641 EventHandler eh = (EventHandler)(Events [LinkColorChangedEvent]);
642 if (eh != null)
643 eh (this, e);
646 protected virtual void OnLinkHoverColorChanged (EventArgs e)
648 EventHandler eh = (EventHandler)(Events [LinkHoverColorChangedEvent]);
649 if (eh != null)
650 eh (this, e);
653 protected virtual void OnMappingNameChanged (EventArgs e)
655 EventHandler eh = (EventHandler)(Events [MappingNameChangedEvent]);
656 if (eh != null)
657 eh (this, e);
660 protected virtual void OnPreferredColumnWidthChanged (EventArgs e)
662 EventHandler eh = (EventHandler)(Events [PreferredColumnWidthChangedEvent]);
663 if (eh != null)
664 eh (this, e);
667 protected virtual void OnPreferredRowHeightChanged (EventArgs e)
669 EventHandler eh = (EventHandler)(Events [PreferredRowHeightChangedEvent]);
670 if (eh != null)
671 eh (this, e);
674 protected virtual void OnReadOnlyChanged (EventArgs e)
676 EventHandler eh = (EventHandler)(Events [ReadOnlyChangedEvent]);
677 if (eh != null)
678 eh (this, e);
681 protected virtual void OnRowHeadersVisibleChanged (EventArgs e)
683 EventHandler eh = (EventHandler)(Events [RowHeadersVisibleChangedEvent]);
684 if (eh != null)
685 eh (this, e);
688 protected virtual void OnRowHeaderWidthChanged (EventArgs e)
690 EventHandler eh = (EventHandler)(Events [RowHeaderWidthChangedEvent]);
691 if (eh != null)
692 eh (this, e);
695 protected virtual void OnSelectionBackColorChanged (EventArgs e)
697 EventHandler eh = (EventHandler)(Events [SelectionBackColorChangedEvent]);
698 if (eh != null)
699 eh (this, e);
702 protected virtual void OnSelectionForeColorChanged (EventArgs e)
704 EventHandler eh = (EventHandler)(Events [SelectionForeColorChangedEvent]);
705 if (eh != null)
706 eh (this, e);
709 public void ResetAlternatingBackColor ()
711 AlternatingBackColor = def_alternating_backcolor;
714 public void ResetBackColor ()
716 BackColor = def_backcolor;
719 public void ResetForeColor ()
721 ForeColor = def_forecolor;
724 public void ResetGridLineColor ()
726 GridLineColor = def_gridline_color;
729 public void ResetHeaderBackColor ()
731 HeaderBackColor = def_header_backcolor;
734 public void ResetHeaderFont ()
736 HeaderFont = def_header_font;
739 public void ResetHeaderForeColor ()
741 HeaderForeColor = def_header_forecolor;
744 public void ResetLinkColor ()
746 LinkColor = def_link_color;
749 public void ResetLinkHoverColor ()
751 LinkHoverColor = def_link_hovercolor;
754 public void ResetSelectionBackColor ()
756 SelectionBackColor = def_selection_backcolor;
759 public void ResetSelectionForeColor ()
761 SelectionForeColor = def_selection_forecolor;
764 protected virtual bool ShouldSerializeAlternatingBackColor ()
766 return (alternating_backcolor != def_alternating_backcolor);
769 protected bool ShouldSerializeBackColor ()
771 return (backcolor != def_backcolor);
774 protected bool ShouldSerializeForeColor ()
776 return (forecolor != def_forecolor);
779 protected virtual bool ShouldSerializeGridLineColor ()
781 return (gridline_color != def_gridline_color);
784 protected virtual bool ShouldSerializeHeaderBackColor ()
786 return (header_backcolor != def_header_backcolor);
789 protected virtual bool ShouldSerializeHeaderForeColor ()
791 return (header_forecolor != def_header_forecolor);
794 protected virtual bool ShouldSerializeLinkColor ()
796 return (link_color != def_link_color);
799 protected virtual bool ShouldSerializeLinkHoverColor ()
801 return (link_hovercolor != def_link_hovercolor);
804 protected bool ShouldSerializePreferredRowHeight ()
806 return (preferredrow_height != def_preferredrow_height);
809 protected bool ShouldSerializeSelectionBackColor ()
811 return (selection_backcolor != def_selection_backcolor);
814 protected virtual bool ShouldSerializeSelectionForeColor ()
816 return (selection_forecolor != def_selection_forecolor);
818 #endregion // Protected Instance Methods
820 #region Private Instance Properties
821 // Create column styles for this TableStyle
822 internal void CreateColumnsForTable (bool onlyBind)
824 CurrencyManager mgr = manager;
825 DataGridColumnStyle st;
827 if (mgr == null) {
828 mgr = datagrid.ListManager;
830 if (mgr == null)
831 return;
834 for (int i = 0; i < column_styles.Count; i ++)
835 column_styles[i].bound = false;
837 table_relations.Clear ();
838 PropertyDescriptorCollection propcol = mgr.GetItemProperties ();
840 for (int i = 0; i < propcol.Count; i++)
842 // The column style is already provided by the user
843 st = column_styles[propcol[i].Name];
844 if (st != null) {
845 if (st.Width == -1)
846 st.Width = CurrentPreferredColumnWidth;
848 st.PropertyDescriptor = propcol[i];
849 st.bound = true;
850 continue;
853 if (onlyBind == true)
854 continue;
856 if (typeof (IBindingList).IsAssignableFrom (propcol[i].PropertyType)) {
857 table_relations.Add (propcol[i].Name);
858 } else {
859 if (propcol[i].IsBrowsable) {
860 st = CreateGridColumn (propcol[i], true);
861 st.bound = true;
862 st.grid = datagrid;
863 st.MappingName = propcol[i].Name;
864 st.HeaderText = propcol[i].Name;
865 st.Width = CurrentPreferredColumnWidth;
866 column_styles.Add (st);
873 #endregion Private Instance Properties
875 #region Events
876 static object AllowSortingChangedEvent = new object ();
877 static object AlternatingBackColorChangedEvent = new object ();
878 static object BackColorChangedEvent = new object ();
879 static object ColumnHeadersVisibleChangedEvent = new object ();
880 static object ForeColorChangedEvent = new object ();
881 static object GridLineColorChangedEvent = new object ();
882 static object GridLineStyleChangedEvent = new object ();
883 static object HeaderBackColorChangedEvent = new object ();
884 static object HeaderFontChangedEvent = new object ();
885 static object HeaderForeColorChangedEvent = new object ();
886 static object LinkColorChangedEvent = new object ();
887 static object LinkHoverColorChangedEvent = new object ();
888 static object MappingNameChangedEvent = new object ();
889 static object PreferredColumnWidthChangedEvent = new object ();
890 static object PreferredRowHeightChangedEvent = new object ();
891 static object ReadOnlyChangedEvent = new object ();
892 static object RowHeadersVisibleChangedEvent = new object ();
893 static object RowHeaderWidthChangedEvent = new object ();
894 static object SelectionBackColorChangedEvent = new object ();
895 static object SelectionForeColorChangedEvent = new object ();
897 public event EventHandler AllowSortingChanged {
898 add { Events.AddHandler (AllowSortingChangedEvent, value); }
899 remove { Events.RemoveHandler (AllowSortingChangedEvent, value); }
902 public event EventHandler AlternatingBackColorChanged {
903 add { Events.AddHandler (AlternatingBackColorChangedEvent, value); }
904 remove { Events.RemoveHandler (AlternatingBackColorChangedEvent, value); }
907 public event EventHandler BackColorChanged {
908 add { Events.AddHandler (BackColorChangedEvent, value); }
909 remove { Events.RemoveHandler (BackColorChangedEvent, value); }
912 public event EventHandler ColumnHeadersVisibleChanged {
913 add { Events.AddHandler (ColumnHeadersVisibleChangedEvent, value); }
914 remove { Events.RemoveHandler (ColumnHeadersVisibleChangedEvent, value); }
917 public event EventHandler ForeColorChanged {
918 add { Events.AddHandler (ForeColorChangedEvent, value); }
919 remove { Events.RemoveHandler (ForeColorChangedEvent, value); }
922 public event EventHandler GridLineColorChanged {
923 add { Events.AddHandler (GridLineColorChangedEvent, value); }
924 remove { Events.RemoveHandler (GridLineColorChangedEvent, value); }
927 public event EventHandler GridLineStyleChanged {
928 add { Events.AddHandler (GridLineStyleChangedEvent, value); }
929 remove { Events.RemoveHandler (GridLineStyleChangedEvent, value); }
932 public event EventHandler HeaderBackColorChanged {
933 add { Events.AddHandler (HeaderBackColorChangedEvent, value); }
934 remove { Events.RemoveHandler (HeaderBackColorChangedEvent, value); }
937 public event EventHandler HeaderFontChanged {
938 add { Events.AddHandler (HeaderFontChangedEvent, value); }
939 remove { Events.RemoveHandler (HeaderFontChangedEvent, value); }
942 public event EventHandler HeaderForeColorChanged {
943 add { Events.AddHandler (HeaderForeColorChangedEvent, value); }
944 remove { Events.RemoveHandler (HeaderForeColorChangedEvent, value); }
947 public event EventHandler LinkColorChanged {
948 add { Events.AddHandler (LinkColorChangedEvent, value); }
949 remove { Events.RemoveHandler (LinkColorChangedEvent, value); }
952 public event EventHandler LinkHoverColorChanged {
953 add { Events.AddHandler (LinkHoverColorChangedEvent, value); }
954 remove { Events.RemoveHandler (LinkHoverColorChangedEvent, value); }
957 public event EventHandler MappingNameChanged {
958 add { Events.AddHandler (MappingNameChangedEvent, value); }
959 remove { Events.RemoveHandler (MappingNameChangedEvent, value); }
962 public event EventHandler PreferredColumnWidthChanged {
963 add { Events.AddHandler (PreferredColumnWidthChangedEvent, value); }
964 remove { Events.RemoveHandler (PreferredColumnWidthChangedEvent, value); }
967 public event EventHandler PreferredRowHeightChanged {
968 add { Events.AddHandler (PreferredRowHeightChangedEvent, value); }
969 remove { Events.RemoveHandler (PreferredRowHeightChangedEvent, value); }
972 public event EventHandler ReadOnlyChanged {
973 add { Events.AddHandler (ReadOnlyChangedEvent, value); }
974 remove { Events.RemoveHandler (ReadOnlyChangedEvent, value); }
977 public event EventHandler RowHeadersVisibleChanged {
978 add { Events.AddHandler (RowHeadersVisibleChangedEvent, value); }
979 remove { Events.RemoveHandler (RowHeadersVisibleChangedEvent, value); }
982 public event EventHandler RowHeaderWidthChanged {
983 add { Events.AddHandler (RowHeaderWidthChangedEvent, value); }
984 remove { Events.RemoveHandler (RowHeaderWidthChangedEvent, value); }
987 public event EventHandler SelectionBackColorChanged {
988 add { Events.AddHandler (SelectionBackColorChangedEvent, value); }
989 remove { Events.RemoveHandler (SelectionBackColorChangedEvent, value); }
992 public event EventHandler SelectionForeColorChanged {
993 add { Events.AddHandler (SelectionForeColorChangedEvent, value); }
994 remove { Events.RemoveHandler (SelectionForeColorChangedEvent, value); }
996 #endregion // Events