Interface IMotorCollection
Namespace: Experior.Interfaces.Collections
Assembly: Experior.Interfaces.dll
Syntax
public interface IMotorCollection
Properties
Item[String]
Gets or sets the element with the specified key.
Declaration
IElectricMotor this[string key] { get; }
Parameters
Type | Name | Description |
---|---|---|
System.String | key | The key. |
Property Value
Type | Description |
---|---|
IElectricMotor | [ERROR: invalid expression ReturnTypeName.FullName]. |
Keys
Gets an System.Collections.Generic.IReadOnlyCollection`{T}} containing the names of the available motors.
Declaration
IReadOnlyCollection<string> Keys { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IReadOnlyCollection<System.String> | The keys. |
Values
Gets an System.Collections.Generic.IReadOnlyCollection`{T}} containing the available motors.
Declaration
IReadOnlyCollection<IElectricMotor> Values { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IReadOnlyCollection<IElectricMotor> | The values. |
Methods
Add(IElectricMotor)
Adds a motor to the global motor list.
Declaration
void Add(IElectricMotor motor)
Parameters
Type | Name | Description |
---|---|---|
IElectricMotor | motor | The motor. |
Clear()
Declaration
void Clear()
ContainsKey(String)
Determines whether the System.Collections.Generic.IDictionary<TKey, TValue> contains an element with the specified key.
Declaration
bool ContainsKey(string key)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | The key to locate in the System.Collections.Generic.IDictionary<TKey, TValue>. |
Returns
Type | Description |
---|---|
System.Boolean | true if the System.Collections.Generic.IDictionary<TKey, TValue> contains an element with the key; otherwise, false. |
Count(Func<IElectricMotor, Boolean>)
Gets the number of motors matching the predicate.
Declaration
int Count(Func<IElectricMotor, bool> predicate = null)
Parameters
Type | Name | Description |
---|---|---|
System.Func<IElectricMotor, System.Boolean> | predicate |
Returns
Type | Description |
---|---|
System.Int32 | The count. |
Get(String)
Declaration
IElectricMotor Get(string name)
Parameters
Type | Name | Description |
---|---|---|
System.String | name |
Returns
Type | Description |
---|---|
IElectricMotor |
Get(UInt64)
Declaration
IElectricMotor Get(ulong entityId)
Parameters
Type | Name | Description |
---|---|---|
System.UInt64 | entityId |
Returns
Type | Description |
---|---|
IElectricMotor |
GetEnumerator()
Returns an enumerator that iterates through the collection.
Declaration
IEnumerator<KeyValuePair<string, IElectricMotor>> GetEnumerator()
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerator<System.Collections.Generic.KeyValuePair<System.String, IElectricMotor>> | A System.Collections.Generic.IEnumerator<T> that can be used to iterate through the collection. |
OfType<T>()
Filters the list of motors based on a specified type.
Declaration
IReadOnlyCollection<T> OfType<T>()
where T : IElectricMotor
Returns
Type | Description |
---|---|
System.Collections.Generic.IReadOnlyCollection<T> | An System.Collections.Generic.IEnumerable<T> that contains elements from the input sequence of type |
Type Parameters
Name | Description |
---|---|
T | The type to filter the elements of the sequence on. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException |
Remove(IElectricMotor)
Removes a motor from the global motor list.
Declaration
bool Remove(IElectricMotor motor)
Parameters
Type | Name | Description |
---|---|---|
IElectricMotor | motor | The motor. |
Returns
Type | Description |
---|---|
System.Boolean |
TryGetValue(String, out IElectricMotor)
Tries the get value.
Declaration
bool TryGetValue(string key, out IElectricMotor value)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | The key. |
IElectricMotor | value | The value. |
Returns
Type | Description |
---|---|
System.Boolean |
|
Events
OnItemsAdded
Raised when motor(s) are added to the collection.
Declaration
event EventHandler<MotorCollectionChangedEventArgs> OnItemsAdded
Event Type
Type | Description |
---|---|
System.EventHandler<MotorCollectionChangedEventArgs> |
OnItemsRemoved
Raised when motor(s) are removed from the collection. System.Collections.Generic.Dictionary<TKey, TValue>
Declaration
event EventHandler<MotorCollectionChangedEventArgs> OnItemsRemoved
Event Type
Type | Description |
---|---|
System.EventHandler<MotorCollectionChangedEventArgs> |