using System.ComponentModel; using System.Drawing; namespace DevComponents.DotNetBar.SuperGrid.Style { /// /// FilterRowVisualStyles /// [TypeConverter(typeof(VisualStylesConverter))] public class GroupByVisualStyles : VisualStyles { } /// /// FilterRowVisualStyle /// [TypeConverter(typeof(VisualStylesConverter))] public class GroupByVisualStyle : TextRowVisualStyle { #region Private variables private Color _GroupBoxBorderColor = Color.Empty; private Color _GroupBoxConnectorColor = Color.Empty; private Color _GroupBoxTextColor = Color.Empty; private Background _GroupBoxBackground; private Color _WatermarkTextColor = Color.Empty; private Font _WatermarkFont; private Background _InsertMarkerBackground; private Color _InsertMarkerBorderColor = Color.Empty; #endregion #region Public properties #region GroupBoxBorderColor /// /// Gets or sets the GroupBox border color /// [Description("Indicates the GroupBox border color")] public Color GroupBoxBorderColor { get { return (_GroupBoxBorderColor); } set { if (_GroupBoxBorderColor != value) { _GroupBoxBorderColor = value; OnPropertyChangedEx("GroupBoxBorderColor", VisualChangeType.Render); } } } /// /// Gets whether property should be serialized. /// [EditorBrowsable(EditorBrowsableState.Never)] private bool ShouldSerializeGroupBoxBorderColor() { return (_GroupBoxBorderColor.IsEmpty == false); } /// /// Resets property to its default value. /// [EditorBrowsable(EditorBrowsableState.Never)] private void ResetGroupBoxBorderColor() { _GroupBoxBorderColor = Color.Empty; } #endregion #region GroupBoxConnectorColor /// /// Gets or sets the GroupBox connector color /// [Description("Indicates the GroupBox connector color")] public Color GroupBoxConnectorColor { get { return (_GroupBoxConnectorColor); } set { if (_GroupBoxConnectorColor != value) { _GroupBoxConnectorColor = value; OnPropertyChangedEx("GroupBoxConnectorColor", VisualChangeType.Render); } } } /// /// Gets whether property should be serialized. /// [EditorBrowsable(EditorBrowsableState.Never)] private bool ShouldSerializeGroupBoxConnectorColor() { return (_GroupBoxBorderColor.IsEmpty == false); } /// /// Resets property to its default value. /// [EditorBrowsable(EditorBrowsableState.Never)] private void ResetGroupBoxConnectorColor() { _GroupBoxBorderColor = Color.Empty; } #endregion #region GroupBoxBackground /// /// Gets or sets the GroupBox indicator background /// [Description("Indicates the RowHeader indicator background.")] public Background GroupBoxBackground { get { if (_GroupBoxBackground == null) { _GroupBoxBackground = Background.Empty; UpdateChangeHandler(null, _GroupBoxBackground); } return (_GroupBoxBackground); } set { if (_GroupBoxBackground != value) { UpdateChangeHandler(_GroupBoxBackground, value); _GroupBoxBackground = value; OnPropertyChangedEx("GroupBoxBackground", VisualChangeType.Render); } } } /// /// Gets whether property should be serialized. /// [EditorBrowsable(EditorBrowsableState.Never)] private bool ShouldSerializeGroupBoxBackground() { return (_GroupBoxBackground != null && _GroupBoxBackground.IsEmpty == false); } /// /// Resets property to its default value. /// [EditorBrowsable(EditorBrowsableState.Never)] private void ResetGroupBoxBackground() { GroupBoxBackground = null; } #endregion #region GroupBoxTextColor /// /// Gets or sets the GroupBox Text color /// [Description("Indicates the GroupBox Text color")] public Color GroupBoxTextColor { get { return (_GroupBoxTextColor); } set { if (_GroupBoxTextColor != value) { _GroupBoxTextColor = value; OnPropertyChangedEx("GroupBoxTextColor", VisualChangeType.Render); } } } /// /// Gets whether property should be serialized. /// [EditorBrowsable(EditorBrowsableState.Never)] private bool ShouldSerializeGroupBoxTextColor() { return (_GroupBoxTextColor.IsEmpty == false); } /// /// Resets property to its default value. /// [EditorBrowsable(EditorBrowsableState.Never)] private void ResetGroupBoxTextColor() { _GroupBoxTextColor = Color.Empty; } #endregion #region InsertMarkerBackground /// /// Gets or sets the Insert Marker background color /// [Description("Indicates the Insert Marker background color")] public Background InsertMarkerBackground { get { if (_InsertMarkerBackground == null) { _InsertMarkerBackground = Background.Empty; UpdateChangeHandler(null, _InsertMarkerBackground); } return (_InsertMarkerBackground); } set { if (_InsertMarkerBackground != value) { UpdateChangeHandler(_InsertMarkerBackground, value); _InsertMarkerBackground = value; OnPropertyChangedEx("InsertMarkerBackground", VisualChangeType.Render); } } } /// /// Gets whether property should be serialized. /// [EditorBrowsable(EditorBrowsableState.Never)] private bool ShouldSerializeInsertMarkerBackground() { return (_InsertMarkerBackground != null && _InsertMarkerBackground.IsEmpty == false); } /// /// Resets property to its default value. /// [EditorBrowsable(EditorBrowsableState.Never)] private void ResetInsertMarkerBackground() { InsertMarkerBackground = null; } #endregion #region InsertMarkerBorderColor /// /// Gets or sets the Insert Marker border color /// [Description("Indicates the Insert Marker border color")] public Color InsertMarkerBorderColor { get { return (_InsertMarkerBorderColor); } set { if (_InsertMarkerBorderColor != value) { _InsertMarkerBorderColor = value; OnPropertyChangedEx("InsertMarkerBorderColor", VisualChangeType.Render); } } } /// /// Gets whether property should be serialized. /// [EditorBrowsable(EditorBrowsableState.Never)] private bool ShouldSerializeInsertMarkerBorderColor() { return (_InsertMarkerBorderColor.IsEmpty == false); } /// /// Resets property to its default value. /// [EditorBrowsable(EditorBrowsableState.Never)] private void ResetInsertMarkerBorderColor() { _InsertMarkerBorderColor = Color.Empty; } #endregion #region WatermarkFont /// /// Gets or sets the style Watermark Font /// [DefaultValue(null)] [Description("Indicates the style Watermark Font")] public Font WatermarkFont { get { return (_WatermarkFont); } set { if (_WatermarkFont != value) { _WatermarkFont = value; OnPropertyChangedEx("WatermarkFont", VisualChangeType.Layout); } } } #endregion #region WatermarkTextColor /// /// Gets or sets the Watermark Text color /// [Description("Indicates the Watermark Text color")] public Color WatermarkTextColor { get { return (_WatermarkTextColor); } set { if (_WatermarkTextColor != value) { _WatermarkTextColor = value; OnPropertyChangedEx("WatermarkTextColor", VisualChangeType.Render); } } } /// /// Gets whether property should be serialized. /// [EditorBrowsable(EditorBrowsableState.Never)] private bool ShouldSerializeWatermarkTextColor() { return (_WatermarkTextColor.IsEmpty == false); } /// /// Resets property to its default value. /// [EditorBrowsable(EditorBrowsableState.Never)] private void ResetWatermarkTextColor() { _WatermarkTextColor = Color.Empty; } #endregion #endregion #region ApplyStyle /// /// Applies the style to instance of this style. /// /// Style to apply. public void ApplyStyle(GroupByVisualStyle style) { if (style != null) { base.ApplyStyle(style); if (style.GroupBoxBorderColor.IsEmpty == false) GroupBoxBorderColor = style.GroupBoxBorderColor; if (style.GroupBoxConnectorColor.IsEmpty == false) GroupBoxConnectorColor = style.GroupBoxConnectorColor; if (style.GroupBoxTextColor.IsEmpty == false) GroupBoxTextColor = style.GroupBoxTextColor; if (style.GroupBoxBackground != null && style.GroupBoxBackground.IsEmpty == false) GroupBoxBackground = style.GroupBoxBackground.Copy(); if (style.InsertMarkerBorderColor.IsEmpty == false) InsertMarkerBorderColor = style.InsertMarkerBorderColor; if (style.InsertMarkerBackground != null && style.InsertMarkerBackground.IsEmpty == false) InsertMarkerBackground = style.InsertMarkerBackground.Copy(); if (style.WatermarkTextColor.IsEmpty == false) WatermarkTextColor = style.WatermarkTextColor; if (style.WatermarkFont != null) WatermarkFont = style.WatermarkFont; } } #endregion #region Copy /// /// Returns the copy of the style. /// /// Copy of the style. public new FilterRowVisualStyle Copy() { FilterRowVisualStyle copy = new FilterRowVisualStyle(); CopyTo(copy); return (copy); } #endregion #region CopyTo /// /// Returns the copy of the style. /// /// Copy of the style. public void CopyTo(GroupByVisualStyle copy) { base.CopyTo(copy); copy.GroupBoxBorderColor = _GroupBoxBorderColor; copy.GroupBoxTextColor = _GroupBoxTextColor; copy.GroupBoxConnectorColor = _GroupBoxConnectorColor; if (_GroupBoxBackground != null) copy.GroupBoxBackground = _GroupBoxBackground.Copy(); copy.InsertMarkerBorderColor = _InsertMarkerBorderColor; if (_InsertMarkerBackground != null) copy.InsertMarkerBackground = _InsertMarkerBackground.Copy(); copy.WatermarkTextColor = _WatermarkTextColor; if (_WatermarkFont != null) copy.Font = (Font)_WatermarkFont.Clone(); } #endregion #region IDisposable /// /// Dispose /// public override void Dispose() { GroupBoxBackground = null; InsertMarkerBackground = null; base.Dispose(); } #endregion } }