WIP
DirectOutput framework for virtual pinball cabinets WIP
Go to:
Overview 
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;
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 
41 
48  public int Number { get; set; }
49 
50  #region Events
51  #region "ValueChanged Event"
52  protected void OnValueChanged()
56  {
57  if (ValueChanged != null)
58  {
59  ValueChanged(this, new OutputEventArgs(this));
60  }
61  }
62 
66  public event ValueChangedEventHandler ValueChanged;
67 
73  public delegate void ValueChangedEventHandler(object sender, OutputEventArgs e);
74 
75 
76 
77  #endregion
78 
79  #endregion
80 
81 
82 
83  }
84 }
Abstract base class for named items. Implements the name property and the necessary events...
Common interface for outputs of any output controller. The Output class implements this interface and...
Definition: IOutput.cs:10
EventArgs for events of IOutput objects.
ValueChangedEventHandler ValueChanged
Event fires if the Value property of the Ouput is changed
Definition: Output.cs:66
The namespace DirectOutput.General contains classes for general use.
Basic IOutput implementation.
Definition: Output.cs:14