Class ParameterMap
A cached map of type members. Can be used to map parameter names to MemberDescription instances.
Inheritance
Inherited Members
Namespace: SpiceSharp.Reflection
Assembly: SpiceSharp.dll
Syntax
public class ParameterMap
Constructors
ParameterMap(Type, IEqualityComparer<String>)
Initializes a new instance of the ParameterMap class.
Declaration
public ParameterMap(Type type, IEqualityComparer<string> comparer)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Type | type | The type. |
| System.Collections.Generic.IEqualityComparer<System.String> | comparer | The comparer used. |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | Thrown if |
Properties
Comparer
Declaration
public IEqualityComparer<string> Comparer { get; }
Property Value
| Type | Description |
|---|---|
| System.Collections.Generic.IEqualityComparer<System.String> |
Members
Declaration
public IEnumerable<MemberDescription> Members { get; }
Property Value
| Type | Description |
|---|---|
| System.Collections.Generic.IEnumerable<MemberDescription> |
Methods
CreateGetter<P>(Object, String)
Creates a getter for a property with the specified name.
Declaration
public Func<P> CreateGetter<P>(object source, string name)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Object | source | The source. |
| System.String | name | The property name. |
Returns
| Type | Description |
|---|---|
| System.Func<P> | The getter; or |
Type Parameters
| Name | Description |
|---|---|
| P | The property value type. |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | Thrown if |
CreateSetter<P>(Object, String)
Creates a setter for a parameter with the specified name.
Declaration
public Action<P> CreateSetter<P>(object source, string name)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Object | source | The source. |
| System.String | name | The parameter name. |
Returns
| Type | Description |
|---|---|
| System.Action<P> | The setter; or |
Type Parameters
| Name | Description |
|---|---|
| P | The parameter value type. |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | Thrown if |
Remap(IEqualityComparer<String>)
Remaps the parameter map using a new comparer.
Declaration
public void Remap(IEqualityComparer<string> comparer)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Collections.Generic.IEqualityComparer<System.String> | comparer | The comparer. |
TryGet<P>(Object, String, out P)
Tries to get the value of a property with the specified name.
Declaration
public bool TryGet<P>(object source, string name, out P value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Object | source | The source. |
| System.String | name | The name. |
| P | value | The value. |
Returns
| Type | Description |
|---|---|
| System.Boolean |
|
Type Parameters
| Name | Description |
|---|---|
| P | The property value type. |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | Thrown if |
TrySet<P>(Object, String, P)
Tries to set the value of a parameter with the specified name.
Declaration
public bool TrySet<P>(object source, string name, P value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Object | source | The source. |
| System.String | name | The name. |
| P | value | The value. |
Returns
| Type | Description |
|---|---|
| System.Boolean |
|
Type Parameters
| Name | Description |
|---|---|
| P | The parameter value type. |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | Thrown if |