WIP
DirectOutput framework for virtual pinball cabinets WIP
Go to:
Overview 
RGBAColorNamed.cs
Go to the documentation of this file.
1 using System;
2 using System.Collections.Generic;
3 using System.Linq;
4 using System.Text;
5 using System.Xml.Serialization;
7 
8 namespace DirectOutput.General.Color
9 {
10 
15  {
16 
17 
18  #region Name
19  private string _Name;
25  public string Name
26  {
27  get { return _Name; }
28  set
29  {
30  if (_Name != value)
31  {
32  string OldName = _Name;
33  if (BeforeNameChanged != null)
34  {
35  BeforeNameChanged(this, new NameChangeEventArgs(OldName, value));
36  }
37 
38  _Name = value;
39 
40  if (AfterNameChanged != null)
41  {
42  AfterNameChanged(this, new NameChangeEventArgs(OldName, value));
43  }
44  }
45  }
46  }
50  public event EventHandler<NameChangeEventArgs> AfterNameChanged;
51 
55  public event EventHandler<NameChangeEventArgs> BeforeNameChanged;
56  #endregion
57 
58  #region Contructor
59  public RGBAColorNamed() { }
71  public RGBAColorNamed(string Name, int BrightnessRed, int BrightnessGreen, int BrightnessBlue)
72  : this()
73  {
74  this.Name = Name;
75  SetColor(BrightnessRed, BrightnessGreen, BrightnessBlue);
76  }
85  public RGBAColorNamed(string Name, int BrightnessRed, int BrightnessGreen, int BrightnessBlue,int Alpha)
86  : this()
87  {
88  this.Name = Name;
89  SetColor(BrightnessRed, BrightnessGreen, BrightnessBlue,Alpha);
90  }
91 
92 
105  public RGBAColorNamed(string Name, string Color)
106  {
107  SetColor(Color);
108  this.Name = Name;
109  }
110 
117  public RGBAColorNamed(string Name, RGBColor RGBColor)
118 
119  {
120  SetColor(RGBColor);
121  this.Name = Name;
122  }
123 
124 
125  #endregion
126  }
127 }
RGBAColorNamed(string Name, int BrightnessRed, int BrightnessGreen, int BrightnessBlue, int Alpha)
Initializes a new instance of the RGBAColorNamed class.
This class stores information on colors used for toys and effects (e.g. RGBLed).
Definition: RGBAColor.cs:14
RGBAColorNamed(string Name, string Color)
Initializes a new instance of the RGBAColorNamed class. The parameter string Color is first parsed f...
This class stores information on RGB colors used for toys and effects (e.g. RGBLed).
Definition: RGBColor.cs:14
Interface for items which can be added the the NamedItemList.
Definition: INamedItem.cs:8
RGBAColorNamed(string Name, RGBColor RGBColor)
Initializes a new instance of the RGBAColorNamed class. The Alpha value is set to 0 if all color comp...
EventHandler< NameChangeEventArgs > BeforeNameChanged
Event is fired before the value of the property Name is changed.
EventHandler< NameChangeEventArgs > AfterNameChanged
Event is fired after the value of the property Name has changed.
The namespace DirectOutput.General contains classes for general use.
RGBAColorNamed(string Name, int BrightnessRed, int BrightnessGreen, int BrightnessBlue)
Initializes a new instance of the RGBAColorNamed class. If all color components are set to 0...
This class stores information on colors used for toys (e.g. RGBLed).