Class ParameterSetCollection
The default implementation of an IParameterSetCollection. This implementation also makes the collection itself an IParameterSet.
Inheritance
Inherited Members
Namespace: SpiceSharp.ParameterSets
Assembly: SpiceSharp.dll
Syntax
public class ParameterSetCollection : ParameterSet, IParameterSetCollection, IParameterSet
Properties
ParameterSets
Gets all the parameter sets of this instance.
Declaration
public virtual IEnumerable<IParameterSet> ParameterSets { get; }
Property Value
Type | Description |
---|---|
IEnumerable<IParameterSet> | The parameter sets. |
Methods
CreateParameterSetter<P>(string)
Creates an action that can set the parameter of the specified type and with the specified name.
Declaration
public override Action<P> CreateParameterSetter<P>(string name)
Parameters
Type | Name | Description |
---|---|---|
string | name | The name of the parameter. |
Returns
Type | Description |
---|---|
Action<P> | An action that can set the parameter value, or |
Type Parameters
Name | Description |
---|---|
P | The parameter value type. |
Overrides
Exceptions
Type | Condition |
---|---|
ArgumentNullException | Thrown if |
CreatePropertyGetter<P>(string)
Creates a function that can get the value of a property of the specified type and with the specified name.
Declaration
public override Func<P> CreatePropertyGetter<P>(string name)
Parameters
Type | Name | Description |
---|---|---|
string | name | The name of the property. |
Returns
Type | Description |
---|---|
Func<P> | A function that can get the property value, or |
Type Parameters
Name | Description |
---|---|
P | The property value type. |
Overrides
Exceptions
Type | Condition |
---|---|
ArgumentNullException | Thrown if |
GetParameterSet<P>()
Gets the parameter set of the specified type.
Declaration
public virtual P GetParameterSet<P>() where P : IParameterSet, ICloneable<P>
Returns
Type | Description |
---|---|
P | The parameter set. |
Type Parameters
Name | Description |
---|---|
P | The parameter set type. |
Exceptions
Type | Condition |
---|---|
TypeNotFoundException | Thrown if the parameter set could not be found. |
GetProperty<P>(string)
Gets the value of a property of the specified type and with the specified name.
Declaration
public override P GetProperty<P>(string name)
Parameters
Type | Name | Description |
---|---|---|
string | name | The name of the property. |
Returns
Type | Description |
---|---|
P | The value of the property. |
Type Parameters
Name | Description |
---|---|
P | The property value type. |
Overrides
Exceptions
Type | Condition |
---|---|
ArgumentNullException | Thrown if |
ParameterNotFoundException | Thrown if a parameter by the specified name could not be found. |
SetParameter<P>(string, P)
Sets a parameter in the parameter set of the specified type and with the specified name.
Declaration
public override void SetParameter<P>(string name, P value)
Parameters
Type | Name | Description |
---|---|---|
string | name | The name of the parameter. |
P | value | The value that the parameter should be set to. |
Type Parameters
Name | Description |
---|---|
P | The parameter value type. |
Overrides
Exceptions
Type | Condition |
---|---|
ArgumentNullException | Thrown if |
ParameterNotFoundException | Thrown if a parameter by the specified name could not be found. |
TryGetParameterSet<P>(out P)
Tries to get the parameter set of the specified type.
Declaration
public virtual bool TryGetParameterSet<P>(out P value) where P : IParameterSet, ICloneable<P>
Parameters
Type | Name | Description |
---|---|---|
P | value | The parameter set. |
Returns
Type | Description |
---|---|
bool |
|
Type Parameters
Name | Description |
---|---|
P | The parameter set type. |
TryGetProperty<P>(string, out P)
Tries to get the value of a property of the specified type and with the specified name.
Declaration
public override bool TryGetProperty<P>(string name, out P value)
Parameters
Type | Name | Description |
---|---|---|
string | name | The name of the property. |
P | value | The value of the property if the property was found. |
Returns
Type | Description |
---|---|
bool |
|
Type Parameters
Name | Description |
---|---|
P | The property value type. |
Overrides
Exceptions
Type | Condition |
---|---|
ArgumentNullException | Thrown if |
TrySetParameter<P>(string, P)
Tries to set a parameter in the parameter set of the specified type and with the specified name.
Declaration
public override bool TrySetParameter<P>(string name, P value)
Parameters
Type | Name | Description |
---|---|---|
string | name | The name of the parameter. |
P | value | The value that the parameter should be set to. |
Returns
Type | Description |
---|---|
bool |
|
Type Parameters
Name | Description |
---|---|
P | The parameter value type. |
Overrides
Exceptions
Type | Condition |
---|---|
ArgumentNullException | Thrown if |