Interface ITypeSet<V>
A set of instances that can also be found by their type.
Inherited Members
Namespace: SpiceSharp.General
Assembly: SpiceSharp.dll
Syntax
public interface ITypeSet<V> : ICollection<V>, IEnumerable<V>, IEnumerable
Type Parameters
Name | Description |
---|---|
V | The base value type. |
Methods
ContainsType(Type)
Determines whether this instance contains a value of the specified type.
Declaration
bool ContainsType(Type key)
Parameters
Type | Name | Description |
---|---|---|
Type | key | The key. |
Returns
Type | Description |
---|---|
bool |
|
Exceptions
Type | Condition |
---|---|
ArgumentNullException | Thrown if |
ContainsType<TResult>()
Determines whether this instance contains a value of the specified type.
Declaration
bool ContainsType<TResult>() where TResult : V
Returns
Type | Description |
---|---|
bool |
|
Type Parameters
Name | Description |
---|---|
TResult | The type of the result. |
GetValue<TResult>()
Gets a value from the set with the specified type.
Declaration
TResult GetValue<TResult>() where TResult : V
Returns
Type | Description |
---|---|
TResult | The value. |
Type Parameters
Name | Description |
---|---|
TResult | The result type. |
Exceptions
Type | Condition |
---|---|
AmbiguousTypeException | Thrown if the type could not be resolved to a single instance. |
TryGetValue<TResult>(out TResult)
Tries getting a value from the set with the specified type.
Declaration
bool TryGetValue<TResult>(out TResult value) where TResult : V
Parameters
Type | Name | Description |
---|---|---|
TResult | value | The value. |
Returns
Type | Description |
---|---|
bool |
|
Type Parameters
Name | Description |
---|---|
TResult | The result type. |
Exceptions
Type | Condition |
---|---|
AmbiguousTypeException | Thrown if the type could not be resolved to a single instance. |
Events
TypeNotFound
Occurs if a type could not be found.
Declaration
event EventHandler<TypeNotFoundEventArgs<V>> TypeNotFound
Event Type
Type | Description |
---|---|
EventHandler<TypeNotFoundEventArgs<V>> |