#if FRAMEWORK20 using System; using System.Collections.Generic; using System.Text; using System.ComponentModel; using System.Drawing; using DevComponents.DotNetBar; namespace DevComponents.Editors.DateTimeAdv { /// /// Defines the visual marking applied to dates through month calendar control. /// [System.ComponentModel.ToolboxItem(false), System.ComponentModel.DesignTimeVisible(false), TypeConverter(typeof(System.ComponentModel.ExpandableObjectConverter))] public class DateAppearanceDescription { #region Private Variables private BaseItem _Parent = null; #endregion #region Events #endregion #region Constructor /// /// Initializes a new instance of the DateAppearanceDescription class. /// public DateAppearanceDescription() { } /// /// Initializes a new instance of the DateAppearanceDescription class. /// /// public DateAppearanceDescription(BaseItem parent) { _Parent = parent; } #endregion #region Internal Implementation /// /// Applies all settings from this object to specified object. /// /// Reference to object. public void ApplyTo(DateAppearanceDescription desc) { desc.BackColor = this.BackColor; desc.BackColor2 = this.BackColor2; desc.BackColorGradientAngle = this.BackColorGradientAngle; desc.BorderColor = this.BorderColor; desc.IsBold = this.IsBold; desc.Selectable = this.Selectable; desc.TextColor = this.TextColor; } private void Refresh() { if (_Parent != null) _Parent.Refresh(); } private bool _IsBold = false; /// /// Gets or sets whether text is drawn using bold font. /// [DefaultValue(false), Description("Indicates whether text is drawn using bold font.")] public bool IsBold { get { return _IsBold; } set { if (_IsBold != value) { _IsBold = value; this.Refresh(); } } } private Color _BackColor = Color.Empty; /// /// Gets or sets the background color for the marked day. /// [Category("Colors"), Description("Indicates background color for the marked day.")] public Color BackColor { get { return _BackColor; } set { _BackColor = value; this.Refresh(); } } /// Gets whether property should be serialized. Provided for WinForms designer support. [EditorBrowsable(EditorBrowsableState.Never)] public bool ShouldSerializeBackColor() { return !BackColor.IsEmpty; } /// Resets property to its default value. Provided for WinForms designer support. [EditorBrowsable(EditorBrowsableState.Never)] public void ResetBackColor() { BackColor = Color.Empty; } private Color _BackColor2 = Color.Empty; /// /// Gets or sets the background target gradient color for the marked date. /// [Category("Colors"), Description("Indicates background target gradient color for the marked date.")] public Color BackColor2 { get { return _BackColor2; } set { _BackColor2 = value; this.Refresh(); } } /// Gets whether property should be serialized. Provided for WinForms designer support. [EditorBrowsable(EditorBrowsableState.Never)] public bool ShouldSerializeBackColor2() { return !BackColor2.IsEmpty; } /// Resets property to its default value. Provided for WinForms designer support. [EditorBrowsable(EditorBrowsableState.Never)] public void ResetBackColor2() { BackColor2 = Color.Empty; } private int _BackColorGradientAngle = 90; /// /// Gets or sets the background gradient fill angle. Default value is 90. /// [DefaultValue(90), Description("Indicates background gradient fill angle.")] public int BackColorGradientAngle { get { return _BackColorGradientAngle; } set { if (_BackColorGradientAngle != value) { _BackColorGradientAngle = value; this.Refresh(); } } } private Color _TextColor = Color.Empty; /// /// Gets or sets the text color for the marked date. /// [Category("Colors"), Description("Indicates text color for the marked date.")] public Color TextColor { get { return _TextColor; } set { _TextColor = value; this.Refresh(); } } /// Gets whether property should be serialized. Provided for WinForms designer support. [EditorBrowsable(EditorBrowsableState.Never)] public bool ShouldSerializeTextColor() { return !TextColor.IsEmpty; } /// Resets property to its default value. Provided for WinForms designer support. [EditorBrowsable(EditorBrowsableState.Never)] public void ResetTextColor() { TextColor = Color.Empty; } /// /// Gets whether any of the appearance values have been changed. /// [Browsable(false)] public bool IsCustomized { get { return !_BackColor.IsEmpty || !_BackColor2.IsEmpty || !_TextColor.IsEmpty || _IsBold || !_BorderColor.IsEmpty; } } internal BaseItem Parent { get { return _Parent; } set { if (_Parent != value) { _Parent = value; } } } private Color _BorderColor = Color.Empty; /// /// Gets or sets the border color. /// [Category("Colors"), Description("Indicates borderColor color.")] public Color BorderColor { get { return _BorderColor; } set { _BorderColor = value; this.Refresh(); } } /// Gets whether property should be serialized. Provided for WinForms designer support. [EditorBrowsable(EditorBrowsableState.Never)] public bool ShouldSerializeBorderColor() { return !BorderColor.IsEmpty; } /// Resets property to its default value. Provided for WinForms designer support. [EditorBrowsable(EditorBrowsableState.Never)] public void ResetBorderColor() { BorderColor = Color.Empty; } private bool _Selectable = true; /// /// Gets or sets whether day marked is selectable by end user. Default value is true. /// [DefaultValue(true), Description("Indicates whether day marked is selectable by end user.")] public bool Selectable { get { return _Selectable; } set { if (_Selectable != value) { _Selectable = value; } } } #endregion } } #endif