Skip to main content

Class IOList<T>

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​
Declaration
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​
Declaration
public string Label { get; set; }

Values​

set all output values in Collection, if there are not Outputs nothing will be set

View Source​
Declaration
public int Values { set; }

AValues​

Set all analog output values in collection, if there are no outputs nothing will be set

View Source​
Declaration
public double AValues { set; }

this[int]​

Get the IOLine at a particular index

View Source​
Declaration
public T this[int index] { get; set; }

Count​

Gets the number of IOLines in the List

View Source​
Declaration
public int Count { get; }

IsReadOnly​

Gets the value indicating whether the IOList is read-only

View Source​
Declaration
public bool IsReadOnly { get; }

Fields​

_numOfRegisteredEvents​

can only be positive

View Source​
Declaration
protected uint _numOfRegisteredEvents

_numOfRegisteredChangeEvents​

can only be positive

View Source​
Declaration
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​
Declaration
protected Dictionary<IOLineChangedEventHandler, bool> _ioLineChangeHandlers

_numOfRegisteredRisingEvents​

can only be positive

View Source​
Declaration
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​
Declaration
protected Dictionary<IOLineChangedEventHandler, bool> _ioLineRisingHandlers

_numOfRegisteredFallingEvents​

can only be positive

View Source​
Declaration
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​
Declaration
protected Dictionary<IOLineChangedEventHandler, bool> _ioLineFallingHandlers

_numOfRegisteredChangedDeltaEvents​

can only be positive

View Source​
Declaration
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​
Declaration
protected Dictionary<AIOLineChangedEventHandler, bool> _aioLineChangedDeltaHandlers

_numOfRegisteredChangedTargetEvents​

can only be positive

View Source​
Declaration
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​
Declaration
protected Dictionary<AIOLineChangedEventHandler, bool> _aioLineChangedTargetHandlers

_numOfRegisteredChangedTargetRangeEvents​

can only be positive

View Source​
Declaration
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​
Declaration
protected Dictionary<AIOLineChangedEventHandler, bool> _aioLineChangedTargetRangeHandlers

Methods​

ToList()​

Convert to List<T>

View Source​
Declaration
public List<T> ToList()
Returns​

System.Collections.Generic.List<<T>>

ToString()​

ToString

View Source​
Declaration
public override string ToString()
Returns​

System.String

Describe()​

Give a complete summary of the EDDevice

View Source​
Declaration
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​
Declaration
public void SubscribeToDeltaEvent(ref AIOLineChangedEventHandler function, double delta)
Parameters​
TypeName
Brainboxes.IO.AIOLineChangedEventHandlerfunction
System.Doubledelta

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​
Declaration
[Obsolete("SubscribeToTargetEvents is deprecated. Replaced by SubscribeToTargetEvent")]
public void SubscribeToTargetEvents(ref AIOLineChangedEventHandler function, double target)
Parameters​
TypeName
Brainboxes.IO.AIOLineChangedEventHandlerfunction
System.Doubletarget

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​
Declaration
public void SubscribeToTargetEvent(ref AIOLineChangedEventHandler function, double target)
Parameters​
TypeName
Brainboxes.IO.AIOLineChangedEventHandlerfunction
System.Doubletarget

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​
Declaration
[Obsolete("SubscribeToTargetRangeEvents is deprecated. Replaced by SubscribeToTargetRangeEvent")]
public void SubscribeToTargetRangeEvents(ref AIOLineChangedEventHandler function, double target, double delta)
Parameters​
TypeName
Brainboxes.IO.AIOLineChangedEventHandlerfunction
System.Doubletarget
System.Doubledelta

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​
Declaration
public void SubscribeToTargetRangeEvent(ref AIOLineChangedEventHandler function, double target, double delta)
Parameters​
TypeName
Brainboxes.IO.AIOLineChangedEventHandlerfunction
System.Doubletarget
System.Doubledelta

UnsubscribeToDeltaEvent(ref AIOLineChangedEventHandler)​

Unsubscribe a registered delta event with this handler to stop being notified when this event is triggered

View Source​
Declaration
public void UnsubscribeToDeltaEvent(ref AIOLineChangedEventHandler function)
Parameters​
TypeName
Brainboxes.IO.AIOLineChangedEventHandlerfunction

UnsubscribeToTargetEvents(ref AIOLineChangedEventHandler)​

Unsubscribe a registered target event with this handler to stop being notified when this event is triggered

View Source​
Declaration
[Obsolete("UnsubscribeToTargetEvents is deprecated. Replaced by UnsubscribeToTargetEvent")]
public void UnsubscribeToTargetEvents(ref AIOLineChangedEventHandler function)
Parameters​
TypeName
Brainboxes.IO.AIOLineChangedEventHandlerfunction

UnsubscribeToTargetEvent(ref AIOLineChangedEventHandler)​

Unsubscribe a registered target event with this handler to stop being notified when this event is triggered

View Source​
Declaration
public void UnsubscribeToTargetEvent(ref AIOLineChangedEventHandler function)
Parameters​
TypeName
Brainboxes.IO.AIOLineChangedEventHandlerfunction

UnsubscribeToTargetRangeEvents(ref AIOLineChangedEventHandler)​

Unsubscribe a registered target range event with this handler to stop being notified when this event is triggered

View Source​
Declaration
[Obsolete("UnsubscribeToTargetRangeEvents is deprecated. Replaced by UnsubscribeToTargetRangeEvent")]
public void UnsubscribeToTargetRangeEvents(ref AIOLineChangedEventHandler function)
Parameters​
TypeName
Brainboxes.IO.AIOLineChangedEventHandlerfunction

UnsubscribeToTargetRangeEvent(ref AIOLineChangedEventHandler)​

Unsubscribe a registered target range event with this handler to stop being notified when this event is triggered

View Source​
Declaration
public void UnsubscribeToTargetRangeEvent(ref AIOLineChangedEventHandler function)
Parameters​
TypeName
Brainboxes.IO.AIOLineChangedEventHandlerfunction

_applyListEvents(T)​

Apply any events which are currently added

View Source​
Declaration
protected void _applyListEvents(T line)
Parameters​
TypeName
<T>line

_removeListEvents(T)​

Remove any events which are currently added

View Source​
Declaration
protected void _removeListEvents(T line)
Parameters​
TypeName
<T>line

IndexOf(T)​

Determine the index of a specific IOLine

View Source​
Declaration
public int IndexOf(T line)
Returns​

System.Int32

Parameters​
TypeName
<T>line

Insert(int, T)​

Insert an IOLine at a specific index

View Source​
Declaration
public void Insert(int index, T line)
Parameters​
TypeName
System.Int32index
<T>line

RemoveAt(int)​

Removes the IOLine at the specific index

View Source​
Declaration
public void RemoveAt(int index)
Parameters​
TypeName
System.Int32index

Add(T)​

Adds an IOLine to the List

View Source​
Declaration
public void Add(T line)
Parameters​
TypeName
<T>line

Clear()​

Removes all IOLines from the list

View Source​
Declaration
public void Clear()

Contains(T)​

Determines whether the list contains a specific IOLine

View Source​
Declaration
public bool Contains(T line)
Returns​

System.Boolean

Parameters​
TypeName
<T>line

CopyTo(T[], int)​

Copies the IOLine(s) starting at a particular index to the supplied array

View Source​
Declaration
public void CopyTo(T[] array, int arrayIndex)
Parameters​
TypeName
<T>[]array
System.Int32arrayIndex

Remove(T)​

Removes the first occurrence of a specific IOLine from the list

View Source​
Declaration
public bool Remove(T line)
Returns​

System.Boolean

Parameters​
TypeName
<T>line

GetEnumerator()​

Returns the IOList enumerator that iterates through the collection

View Source​
Declaration
public IEnumerator<T> GetEnumerator()
Returns​

System.Collections.Generic.IEnumerator<<T>>

AsReadOnly()​

Converts the IOList to a Read-only List

View Source​
Declaration
public IOList<T> AsReadOnly()
Returns​

Brainboxes.IO.IOList<T>

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​
Declaration
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​
Declaration
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​
Declaration
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