WIP
DirectOutput framework for virtual pinball cabinets WIP
Go to:
Overview 
RGBColorNamed.cs
Go to the documentation of this file.
1 using System;
2 using System.Collections.Generic;
3 using System.Linq;
4 using System.Text;
6 using System.Xml.Serialization;
7 
8 namespace DirectOutput.General.Color
9 {
14  {
15 
16  #region Name
17  private string _Name;
24  public string Name
25  {
26  get { return _Name; }
27  set
28  {
29  if (_Name != value)
30  {
31  string OldName = _Name;
32  if (BeforeNameChanged != null)
33  {
34  BeforeNameChanged(this, new NameChangeEventArgs(OldName, value));
35  }
36 
37  _Name = value;
38 
39  if (AfterNameChanged != null)
40  {
41  AfterNameChanged(this, new NameChangeEventArgs(OldName, value));
42  }
43  }
44  }
45  }
49  public event EventHandler<NameChangeEventArgs> AfterNameChanged;
50 
54  public event EventHandler<NameChangeEventArgs> BeforeNameChanged;
55  #endregion
56 
57 
58 
59  #region Contructor
60  public RGBColorNamed() { }
71  public RGBColorNamed(string Name, int BrightnessRed, int BrightnessGreen, int BrightnessBlue)
72  : this()
73  {
74  this.Name = Name;
75  SetColor(BrightnessRed, BrightnessGreen, BrightnessBlue);
76  }
77 
78 
85  public RGBColorNamed(string Name, string Color)
86  {
87  SetColor(Color);
88  this.Name = Name;
89  }
90 
91  #endregion
92  }
93 }
EventHandler< NameChangeEventArgs > AfterNameChanged
Event is fired after the value of the property Name has changed.
EventHandler< NameChangeEventArgs > BeforeNameChanged
Event is fired before the value of the property Name is changed.
RGBColorNamed(string Name, int BrightnessRed, int BrightnessGreen, int BrightnessBlue)
Initializes a new instance of the RGBColorNamed class.
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
RGBColorNamed(string Name, string Color)
Initializes a new instance of the RGBColorNamed class. The parameter string Color ist first parsed f...
The namespace DirectOutput.General contains classes for general use.