DirectOutputR1
DirectOutput framework R1 for virtual pinball cabinets.
Go to:
Overview 
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Properties Events Macros Pages
Output.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 DirectOutput.General.Generic;
6 using System.Xml.Serialization;
7 
8 namespace DirectOutput.Cab.Out
9 {
10 
14  public class Output : NamedItemBase, IOutput
15  {
16 
17  private object ValueChangeLocker = new object();
18  private byte _Value = 0;
19 
24  [XmlIgnoreAttribute]
25  public byte Value
26  {
27  get { return _Value; }
28  set
29  {
30  byte OldValue;
31  lock (ValueChangeLocker)
32  {
33  OldValue = _Value;
34  _Value = value;
35  }
36  if (OldValue!=value) OnValueChanged();
37  }
38  }
39 
40  #region Events
41  #region "ValueChanged Event"
42 
43 
44 
45  protected void OnValueChanged()
46  {
47  if (ValueChanged != null)
48  {
49  ValueChanged(this, new OutputEventArgs(this));
50  }
51  }
52 
56  public event ValueChangedEventHandler ValueChanged;
57 
63  public delegate void ValueChangedEventHandler(object sender, OutputEventArgs e);
64 
65 
66 
67  #endregion
68 
69  #endregion
70 
71 
72 
73  }
74 }