Class IOList<T>
List to hold any number of IOLines. Provides convenience methods for register events to all lines in the list and setting values of all outputs
Assembly: Brainboxes.IO.dll
View Source
public class IOList<T> : IList<T>, ICollection<T>, IEnumerable<T>, IEnumerable where T : IOLine
Implements:
System.Collections.Generic.IList<<T>>, System.Collections.Generic.ICollection<<T>>, System.Collections.Generic.IEnumerable<<T>>, System.Collections.IEnumerable
Properties
Label
User definable label for the IOList to help identify/ when debugging
View Source
public string Label { get; set; }
Values
set all output values in Collection, if there are not Outputs nothing will be set
View Source
public int Values { set; }
AValues
Set all analog output values in collection, if there are no outputs nothing will be set
View Source
public double AValues { set; }
this[int]
Get the IOLine at a particular index
View Source
public T this[int index] { get; set; }
Count
Gets the number of IOLines in the List
View Source
public int Count { get; }
IsReadOnly
Gets the value indicating whether the IOList is read-only
View Source
public bool IsReadOnly { get; }
Fields
_numOfRegisteredEvents
can only be positive
View Source
protected uint _numOfRegisteredEvents
_numOfRegisteredChangeEvents
can only be positive
View Source
protected uint _numOfRegisteredChangeEvents
_ioLineChangeHandlers
use dictionary t bool as an alternative to hashset (only available in .net 3.5+) this means only unique events can be added and existing events removed
View Source
protected Dictionary<IOLineChangedEventHandler, bool> _ioLineChangeHandlers
_numOfRegisteredRisingEvents
can only be positive
View Source
protected uint _numOfRegisteredRisingEvents
_ioLineRisingHandlers
use dictionary t bool as an alternative to hashset (only available in .net 3.5+) this means only unique events can be added and existing events removed
View Source
protected Dictionary<IOLineChangedEventHandler, bool> _ioLineRisingHandlers
_numOfRegisteredFallingEvents
can only be positive
View Source
protected uint _numOfRegisteredFallingEvents
_ioLineFallingHandlers
use dictionary t bool as an alternative to hashset (only available in .net 3.5+) this means only unique events can be added and existing events removed
View Source
protected Dictionary<IOLineChangedEventHandler, bool> _ioLineFallingHandlers
_numOfRegisteredChangedDeltaEvents
can only be positive
View Source
protected uint _numOfRegisteredChangedDeltaEvents
_aioLineChangedDeltaHandlers
use dictionary t bool as an alternative to hashset (only available in .net 3.5+) this means only unique events can be added and existing events removed
View Source
protected Dictionary<AIOLineChangedEventHandler, bool> _aioLineChangedDeltaHandlers
_numOfRegisteredChangedTargetEvents
can only be positive
View Source
protected uint _numOfRegisteredChangedTargetEvents
_aioLineChangedTargetHandlers
use dictionary t bool as an alternative to hashset (only available in .net 3.5+) this means only unique events can be added and existing events removed
View Source
protected Dictionary<AIOLineChangedEventHandler, bool> _aioLineChangedTargetHandlers
_numOfRegisteredChangedTargetRangeEvents
can only be positive
View Source
protected uint _numOfRegisteredChangedTargetRangeEvents
_aioLineChangedTargetRangeHandlers
use dictionary t bool as an alternative to hashset (only available in .net 3.5+) this means only unique events can be added and exisiting events removed
View Source
protected Dictionary<AIOLineChangedEventHandler, bool> _aioLineChangedTargetRangeHandlers
Methods
ToList()
Convert to List<T>
View Source
public List<T> ToList()
Returns
System.Collections.Generic.List<<T>>
ToString()
ToString
View Source
public override string ToString()
Returns
System.String
Describe()
Give a complete summary of the EDDevice
View Source
public string Describe()
Returns
System.String
SubscribeToDeltaEvent(ref AIOLineChangedEventHandler, double)
Register an event with this handler to be notified when the state of this AIOLines in the list changes over the delta value specified. If IOLines are subsequently added or removed then the events will also be applied The same event cannot be added twice (function will return and do nothing) The event can be unregistered using the UnsubscribeToDeltaEvent
View Source
public void SubscribeToDeltaEvent(ref AIOLineChangedEventHandler function, double delta)
Parameters
| Type | Name |
|---|---|
| Brainboxes.IO.AIOLineChangedEventHandler | function |
System.Double | delta |
SubscribeToTargetEvents(ref AIOLineChangedEventHandler, double)
Register event with this handler to be notified when the state of this AIOLines in the list goes over the value specified and below the value specified. If IOLines are subsequently added or removed then the events will also be applied The same event cannot be added twice (function will return and do nothing) The event can be unregistered using the UnsubscribeToTargetEvents
View Source
[Obsolete("SubscribeToTargetEvents is deprecated. Replaced by SubscribeToTargetEvent")]
public void SubscribeToTargetEvents(ref AIOLineChangedEventHandler function, double target)
Parameters
| Type | Name |
|---|---|
| Brainboxes.IO.AIOLineChangedEventHandler | function |
System.Double | target |
SubscribeToTargetEvent(ref AIOLineChangedEventHandler, double)
Register event with this handler to be notified when the state of this AIOLines in the list goes over the value specified and below the value specified. If IOLines are subsequently added or removed then the events will also be applied The same event cannot be added twice (function will return and do nothing) The event can be unregistered using the UnsubscribeToTargetEvents
View Source
public void SubscribeToTargetEvent(ref AIOLineChangedEventHandler function, double target)
Parameters
| Type | Name |
|---|---|
| Brainboxes.IO.AIOLineChangedEventHandler | function |
System.Double | target |
SubscribeToTargetRangeEvents(ref AIOLineChangedEventHandler, double, double)
Register event with this handler to be notified when the state of this AIOLines in the list changes more than the specified delta value away from the specified target value. If IOlines are subsequently added or removed then the events will also be applied The same event cannot be added twice (function will return and do nothing) The event can be unregistered using the UnsubscribeToTargetRangeEvents
View Source
[Obsolete("SubscribeToTargetRangeEvents is deprecated. Replaced by SubscribeToTargetRangeEvent")]
public void SubscribeToTargetRangeEvents(ref AIOLineChangedEventHandler function, double target, double delta)
Parameters
| Type | Name |
|---|---|
| Brainboxes.IO.AIOLineChangedEventHandler | function |
System.Double | target |
System.Double | delta |
SubscribeToTargetRangeEvent(ref AIOLineChangedEventHandler, double, double)
Register event with this handler to be notified when the state of this AIOLines in the list changes more than the specified delta value away from the specified target value. If IOlines are subsequently added or removed then the events will also be applied The same event cannot be added twice (function will return and do nothing) The event can be unregistered using the UnsubscribeToTargetRangeEvents
View Source
public void SubscribeToTargetRangeEvent(ref AIOLineChangedEventHandler function, double target, double delta)
Parameters
| Type | Name |
|---|---|
| Brainboxes.IO.AIOLineChangedEventHandler | function |
System.Double | target |
System.Double | delta |
UnsubscribeToDeltaEvent(ref AIOLineChangedEventHandler)
Unsubscribe a registered delta event with this handler to stop being notified when this event is triggered
View Source
public void UnsubscribeToDeltaEvent(ref AIOLineChangedEventHandler function)
Parameters
| Type | Name |
|---|---|
| Brainboxes.IO.AIOLineChangedEventHandler | function |
UnsubscribeToTargetEvents(ref AIOLineChangedEventHandler)
Unsubscribe a registered target event with this handler to stop being notified when this event is triggered
View Source
[Obsolete("UnsubscribeToTargetEvents is deprecated. Replaced by UnsubscribeToTargetEvent")]
public void UnsubscribeToTargetEvents(ref AIOLineChangedEventHandler function)
Parameters
| Type | Name |
|---|---|
| Brainboxes.IO.AIOLineChangedEventHandler | function |
UnsubscribeToTargetEvent(ref AIOLineChangedEventHandler)
Unsubscribe a registered target event with this handler to stop being notified when this event is triggered
View Source
public void UnsubscribeToTargetEvent(ref AIOLineChangedEventHandler function)
Parameters
| Type | Name |
|---|---|
| Brainboxes.IO.AIOLineChangedEventHandler | function |
UnsubscribeToTargetRangeEvents(ref AIOLineChangedEventHandler)
Unsubscribe a registered target range event with this handler to stop being notified when this event is triggered
View Source
[Obsolete("UnsubscribeToTargetRangeEvents is deprecated. Replaced by UnsubscribeToTargetRangeEvent")]
public void UnsubscribeToTargetRangeEvents(ref AIOLineChangedEventHandler function)
Parameters
| Type | Name |
|---|---|
| Brainboxes.IO.AIOLineChangedEventHandler | function |
UnsubscribeToTargetRangeEvent(ref AIOLineChangedEventHandler)
Unsubscribe a registered target range event with this handler to stop being notified when this event is triggered
View Source
public void UnsubscribeToTargetRangeEvent(ref AIOLineChangedEventHandler function)
Parameters
| Type | Name |
|---|---|
| Brainboxes.IO.AIOLineChangedEventHandler | function |
_applyListEvents(T)
Apply any events which are currently added
View Source
protected void _applyListEvents(T line)
Parameters
| Type | Name |
|---|---|
<T> | line |
_removeListEvents(T)
Remove any events which are currently added
View Source
protected void _removeListEvents(T line)
Parameters
| Type | Name |
|---|---|
<T> | line |
IndexOf(T)
Determine the index of a specific IOLine
View Source
public int IndexOf(T line)
Returns
System.Int32
Parameters
| Type | Name |
|---|---|
<T> | line |
Insert(int, T)
Insert an IOLine at a specific index
View Source
public void Insert(int index, T line)
Parameters
| Type | Name |
|---|---|
System.Int32 | index |
<T> | line |
RemoveAt(int)
Removes the IOLine at the specific index
View Source
public void RemoveAt(int index)
Parameters
| Type | Name |
|---|---|
System.Int32 | index |
Add(T)
Adds an IOLine to the List
View Source
public void Add(T line)
Parameters
| Type | Name |
|---|---|
<T> | line |
Clear()
Removes all IOLines from the list
View Source
public void Clear()
Contains(T)
Determines whether the list contains a specific IOLine
View Source
public bool Contains(T line)
Returns
System.Boolean
Parameters
| Type | Name |
|---|---|
<T> | line |
CopyTo(T[], int)
Copies the IOLine(s) starting at a particular index to the supplied array
View Source
public void CopyTo(T[] array, int arrayIndex)
Parameters
| Type | Name |
|---|---|
<T>[] | array |
System.Int32 | arrayIndex |
Remove(T)
Removes the first occurrence of a specific IOLine from the list
View Source
public bool Remove(T line)
Returns
System.Boolean
Parameters
| Type | Name |
|---|---|
<T> | line |
GetEnumerator()
Returns the IOList enumerator that iterates through the collection
View Source
public IEnumerator<T> GetEnumerator()
Returns
System.Collections.Generic.IEnumerator<<T>>
AsReadOnly()
Converts the IOList to a Read-only List
View Source
public IOList<T> AsReadOnly()
Returns
Events
IOLineChange
Add/remove IOLineChange event to all lines in the list, if IOLines are subsequently added or removed then the events will also be applied The same event cannot be added twice (function will return and do nothing) If events are removed which were not previously added, they will still be attempted to be removed from the IOLine
View Source
public event IOLineChangedEventHandler IOLineChange
Event Type
Brainboxes.IO.IOLineChangedEventHandler
IOLineRisingEdge
Add/remove IOLineRisingEdge event to all lines in the list, if IOLines are subsequently added or removed then the events will also be applied The same event cannot be added twice (function will return and do nothing) If events are removed which were not previously added, they will still be attempted to be removed from the IOLine
View Source
public event IOLineChangedEventHandler IOLineRisingEdge
Event Type
Brainboxes.IO.IOLineChangedEventHandler
IOLineFallingEdge
Add/remove IOLineFallingEdge event to all lines in the list, if IOLines are subsequently added or removed then the events will also be applied The same event cannot be added twice (function will return and do nothing) If events are removed which were not previously added, they will still be attempted to be removed from the IOLine
View Source
public event IOLineChangedEventHandler IOLineFallingEdge
Event Type
Brainboxes.IO.IOLineChangedEventHandler
Implements
System.Collections.Generic.IList<<T>>System.Collections.Generic.ICollection<<T>>System.Collections.Generic.IEnumerable<<T>>System.Collections.IEnumerable