using System; using System.Collections.Generic; using System.Text; using System.ComponentModel; using System.Drawing; namespace DevComponents.DotNetBar.Rendering { /// /// Defines colors used by Radial Menu Component. /// [ToolboxItem(false), DesignTimeVisible(false), TypeConverter(typeof(System.ComponentModel.ExpandableObjectConverter))] public class RadialMenuColorTable : Component, INotifyPropertyChanged { #region Implementation public void Apply(RadialMenuColorTable table) { table.CircularBackColor = this.CircularBackColor; table.CircularBorderColor = this.CircularBorderColor; table.CircularForeColor = this.CircularForeColor; table.RadialMenuBackground = this.RadialMenuBackground; table.RadialMenuBorder = this.RadialMenuBorder; table.RadialMenuButtonBackground = this.RadialMenuButtonBackground; table.RadialMenuButtonBorder = this.RadialMenuButtonBorder; table.RadialMenuExpandForeground = this.RadialMenuExpandForeground; table.RadialMenuInactiveBorder = this.RadialMenuInactiveBorder; table.RadialMenuItemForeground = this.RadialMenuItemForeground; table.RadialMenuItemDisabledForeground = this.RadialMenuItemDisabledForeground; table.RadialMenuItemMouseOverBackground = this.RadialMenuItemMouseOverBackground; table.RadialMenuItemMouseOverForeground = this.RadialMenuItemMouseOverForeground; table.RadialMenuMouseOverBorder = this.RadialMenuMouseOverBorder; } private void OnPropertyChanged(string propertyName) { OnPropertyChanged(new PropertyChangedEventArgs(propertyName)); } private Color _RadialMenuButtonBackground = Color.Empty; /// /// Gets or sets the color of the Radial Menu button background. /// [Category("Appearance"), Description("Indicates color of Radial Menu button background.")] public Color RadialMenuButtonBackground { get { return _RadialMenuButtonBackground; } set { _RadialMenuButtonBackground = value; OnPropertyChanged("RadialMenuButtonBorder"); } } /// /// Gets whether property should be serialized. /// [EditorBrowsable(EditorBrowsableState.Never)] public bool ShouldSerializeRadialMenuButtonBackground() { return !_RadialMenuButtonBackground.IsEmpty; } /// /// Resets property to its default value. /// [EditorBrowsable(EditorBrowsableState.Never)] public void ResetRadialMenuButtonBackground() { this.RadialMenuButtonBackground = Color.Empty; } private Color _RadialMenuButtonBorder = Color.Empty; /// /// Gets or sets the color of the radial menu button border. /// [Category("Appearance"), Description("Indicates color of Radial Menu Button border.")] public Color RadialMenuButtonBorder { get { return _RadialMenuButtonBorder; } set { _RadialMenuButtonBorder = value; OnPropertyChanged("RadialMenuButtonBorder"); } } /// /// Gets whether property should be serialized. /// [EditorBrowsable(EditorBrowsableState.Never)] public bool ShouldSerializeRadialMenuButtonBorder() { return !_RadialMenuButtonBorder.IsEmpty; } /// /// Resets property to its default value. /// [EditorBrowsable(EditorBrowsableState.Never)] public void ResetRadialMenuButtonBorder() { this.RadialMenuButtonBorder = Color.Empty; } private Color _RadialMenuBackground = Color.Empty; /// /// Gets or sets the color of the Radial Menu background. /// [Category("Appearance"), Description("Indicates color of Radial Menu background.")] public Color RadialMenuBackground { get { return _RadialMenuBackground; } set { _RadialMenuBackground = value; OnPropertyChanged("RadialMenuBackground"); } } /// /// Gets whether property should be serialized. /// [EditorBrowsable(EditorBrowsableState.Never)] public bool ShouldSerializeRadialMenuBackground() { return !_RadialMenuBackground.IsEmpty; } /// /// Resets property to its default value. /// [EditorBrowsable(EditorBrowsableState.Never)] public void ResetRadialMenuBackground() { this.RadialMenuBackground = Color.Empty; } private Color _RadialMenuBorder = Color.Empty; /// /// Gets or sets the color of the Radial Menu border /// [Category("Appearance"), Description("Indicates color of Radial Menu border.")] public Color RadialMenuBorder { get { return _RadialMenuBorder; } set { _RadialMenuBorder = value; OnPropertyChanged("RadialMenuBorder"); } } /// /// Gets whether property should be serialized. /// [EditorBrowsable(EditorBrowsableState.Never)] public bool ShouldSerializeRadialMenuBorder() { return !_RadialMenuBorder.IsEmpty; } /// /// Resets property to its default value. /// [EditorBrowsable(EditorBrowsableState.Never)] public void ResetRadialMenuBorder() { this.RadialMenuBorder = Color.Empty; } private Color _RadialMenuMouseOverBorder = Color.Empty; /// /// Gets or sets the color of border for mouse over state for the radial menu item expand part. /// [Category("Appearance"), Description("Indicates color of border for mouse over state for the radial menu items expand part.")] public Color RadialMenuMouseOverBorder { get { return _RadialMenuMouseOverBorder; } set { _RadialMenuMouseOverBorder = value; OnPropertyChanged("RadialMenuMouseOverBorder"); } } /// /// Gets whether property should be serialized. /// [EditorBrowsable(EditorBrowsableState.Never)] public bool ShouldSerializeRadialMenuMouseOverBorder() { return !_RadialMenuMouseOverBorder.IsEmpty; } /// /// Resets property to its default value. /// [EditorBrowsable(EditorBrowsableState.Never)] public void ResetRadialMenuMouseOverBorder() { this.RadialMenuMouseOverBorder = Color.Empty; } private Color _RadialMenuInactiveBorder = Color.Empty; /// /// Gets or sets the color of the radial menu border for parts where items do not have sub-items, i.e. non-active area of the border. /// [Category("Appearance"), Description("Indicates color of radial menu border for parts where items do not have sub-items, i.e. non-active area of the border..")] public Color RadialMenuInactiveBorder { get { return _RadialMenuInactiveBorder; } set { _RadialMenuInactiveBorder = value; OnPropertyChanged("RadialMenuInactiveBorder"); } } /// /// Gets whether property should be serialized. /// [EditorBrowsable(EditorBrowsableState.Never)] public bool ShouldSerializeRadialMenuInactiveBorder() { return !_RadialMenuInactiveBorder.IsEmpty; } /// /// Resets property to its default value. /// [EditorBrowsable(EditorBrowsableState.Never)] public void ResetRadialMenuInactiveBorder() { this.RadialMenuInactiveBorder = Color.Empty; } private Color _RadialMenuExpandForeground = Color.Empty; /// /// Gets or sets the color of the expand sign which shows menu item sub-items. /// [Category("Appearance"), Description("Indicates color of expand sign which shows menu item sub-items..")] public Color RadialMenuExpandForeground { get { return _RadialMenuExpandForeground; } set { _RadialMenuExpandForeground = value; OnPropertyChanged("RadialMenuExpandForeground"); } } /// /// Gets whether property should be serialized. /// [EditorBrowsable(EditorBrowsableState.Never)] public bool ShouldSerializeRadialMenuExpandForeground() { return !_RadialMenuExpandForeground.IsEmpty; } /// /// Resets property to its default value. /// [EditorBrowsable(EditorBrowsableState.Never)] public void ResetRadialMenuExpandForeground() { this.RadialMenuExpandForeground = Color.Empty; } private Color _RadialMenuItemForeground = Color.Empty; /// /// Gets or sets the color of the radial menu item text. /// [Category("Appearance"), Description("Indicates color of radial menu item text.")] public Color RadialMenuItemForeground { get { return _RadialMenuItemForeground; } set { _RadialMenuItemForeground = value; OnPropertyChanged("RadialMenuItemForeground"); } } /// /// Gets whether property should be serialized. /// [EditorBrowsable(EditorBrowsableState.Never)] public bool ShouldSerializeRadialMenuItemForeground() { return !_RadialMenuItemForeground.IsEmpty; } /// /// Resets property to its default value. /// [EditorBrowsable(EditorBrowsableState.Never)] public void ResetRadialMenuItemForeground() { this.RadialMenuItemForeground = Color.Empty; } private Color _RadialMenuItemMouseOverBackground = Color.Empty; /// /// Gets or sets the color of the radial menu item mouse over background. /// [Category("Appearance"), Description("Indicates color of radial menu item mouse over background.")] public Color RadialMenuItemMouseOverBackground { get { return _RadialMenuItemMouseOverBackground; } set { _RadialMenuItemMouseOverBackground = value; OnPropertyChanged("RadialMenuItemMouseOverBackground"); } } /// /// Gets whether property should be serialized. /// [EditorBrowsable(EditorBrowsableState.Never)] public bool ShouldSerializeRadialMenuItemMouseOverBackground() { return !_RadialMenuItemMouseOverBackground.IsEmpty; } /// /// Resets property to its default value. /// [EditorBrowsable(EditorBrowsableState.Never)] public void ResetRadialMenuItemMouseOverBackground() { this.RadialMenuItemMouseOverBackground = Color.Empty; } private Color _RadialMenuItemMouseOverForeground = Color.Empty; /// /// Gets or sets the color of the radial menu item mouse over foreground. /// [Category("Appearance"), Description("Indicates color of radial menu item mouse over foreground.")] public Color RadialMenuItemMouseOverForeground { get { return _RadialMenuItemMouseOverForeground; } set { _RadialMenuItemMouseOverForeground = value; OnPropertyChanged("RadialMenuItemMouseOverForeground"); } } /// /// Gets whether property should be serialized. /// [EditorBrowsable(EditorBrowsableState.Never)] public bool ShouldSerializeRadialMenuItemMouseOverForeground() { return !_RadialMenuItemMouseOverForeground.IsEmpty; } /// /// Resets property to its default value. /// [EditorBrowsable(EditorBrowsableState.Never)] public void ResetRadialMenuItemMouseOverForeground() { this.RadialMenuItemMouseOverForeground = Color.Empty; } private Color _RadialMenuItemDisabledForeground = Color.Empty; /// /// Gets or sets the color of the radial menu item foreground when disabled. /// [Category("Appearance"), Description("Indicates color of radial menu item foreground when disabled.")] public Color RadialMenuItemDisabledForeground { get { return _RadialMenuItemDisabledForeground; } set { _RadialMenuItemDisabledForeground = value; OnPropertyChanged("_RadialMenuItemDisabledForeground"); } } /// /// Gets whether property should be serialized. /// [EditorBrowsable(EditorBrowsableState.Never)] public bool ShouldSerialize_RadialMenuItemDisabledForeground() { return !_RadialMenuItemDisabledForeground.IsEmpty; } /// /// Resets property to its default value. /// [EditorBrowsable(EditorBrowsableState.Never)] public void Reset_RadialMenuItemDisabledForeground() { this.RadialMenuItemDisabledForeground = Color.Empty; } #endregion #region Circular Menu Type private Color _CircularBackColor = Color.Empty; /// /// Gets or sets background color of the circular menu item type. Applies only to circular menu types. /// [Category("Appearance"), Description("Indicates background color of the circular menu item type.")] public Color CircularBackColor { get { return _CircularBackColor; } set { _CircularBackColor = value; OnPropertyChanged("CircularBackColor"); } } /// /// Gets whether property should be serialized. /// [EditorBrowsable(EditorBrowsableState.Never)] public bool ShouldSerializeCircularBackColor() { return !_CircularBackColor.IsEmpty; } /// /// Resets property to its default value. /// [EditorBrowsable(EditorBrowsableState.Never)] public void ResetCircularBackColor() { this.CircularBackColor = Color.Empty; } private Color _CircularForeColor = Color.Empty; /// /// Gets or sets text color of the circular menu item type. Applies only to circular menu types. /// [Category("Appearance"), Description("Indicates text color of the circular menu item type.")] public Color CircularForeColor { get { return _CircularForeColor; } set { _CircularForeColor = value; OnPropertyChanged("CircularForeColor"); } } /// /// Gets whether property should be serialized. /// [EditorBrowsable(EditorBrowsableState.Never)] public bool ShouldSerializeCircularForeColor() { return !_CircularForeColor.IsEmpty; } /// /// Resets property to its default value. /// [EditorBrowsable(EditorBrowsableState.Never)] public void ResetCircularForeColor() { this.CircularForeColor = Color.Empty; } private Color _CircularBorderColor = Color.Empty; /// /// Gets or sets border color of the circular menu item type. Applies only to circular menu types. /// [Category("Appearance"), Description("Indicates border color of the circular menu item type.")] public Color CircularBorderColor { get { return _CircularBorderColor; } set { _CircularBorderColor = value; OnPropertyChanged("CircularBorderColor"); } } /// /// Gets whether property should be serialized. /// [EditorBrowsable(EditorBrowsableState.Never)] public bool ShouldSerializeCircularBorderColor() { return !_CircularBorderColor.IsEmpty; } /// /// Resets property to its default value. /// [EditorBrowsable(EditorBrowsableState.Never)] public void ResetCircularBorderColor() { this.CircularBorderColor = Color.Empty; } #endregion #region INotifyPropertyChanged Members /// /// Occurs when property value has changed. /// public event PropertyChangedEventHandler PropertyChanged; /// /// Raises the PropertyChanged event. /// /// Event arguments protected virtual void OnPropertyChanged(PropertyChangedEventArgs e) { PropertyChangedEventHandler eh = PropertyChanged; if (eh != null) eh(this, e); } #endregion } }