A parameter that is identified according to an integer representing its
position in an argument list. When applied to a reflection-based
component, Position will be matched against
the indices of the component's constructor arguments. When applied to
a delegate-based component, the parameter can be accessed using
Positional<(Of <(T>)>)(IEnumerable<(Of <(Parameter>)>), Int32).
| C# | Visual Basic | Visual C++ |
public class PositionalParameter : ConstantParameter
Public Class PositionalParameter _ Inherits ConstantParameter
public ref class PositionalParameter : public ConstantParameter
| All Members | Constructors | Methods | Properties | ||
| Icon | Member | Description |
|---|---|---|
| PositionalParameter(Int32, Object) |
Construct a positional parameter with the specified constant value.
| |
| CanSupplyValue(ParameterInfo, IComponentContext, Func<(Of <(Object>)>)%) |
Returns true if the parameter is able to provide a value to a particular site.
(Inherited from ConstantParameter.) | |
| Equals(Object) | (Inherited from Object.) | |
| Finalize()()() |
Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
(Inherited from Object.) | |
| GetHashCode()()() |
Serves as a hash function for a particular type.
(Inherited from Object.) | |
| GetType()()() |
Gets the Type of the current instance.
(Inherited from Object.) | |
| MemberwiseClone()()() |
Creates a shallow copy of the current Object.
(Inherited from Object.) | |
| Position |
The zero-based position of the parameter.
| |
| ToString()()() | (Inherited from Object.) | |
| Value |
The value of the parameter.
(Inherited from ConstantParameter.) |
Component with parameter:
CopyC#
Providing the parameter:
CopyC#
public class MyComponent { public MyComponent(int amount) { ... } }
var builder = new ContainerBuilder(); builder.RegisterType<MyComponent>(); var container = builder.Build(); var myComponent = container.Resolve<MyComponent>(new PositionalParameter(0, 123));
| Object | |||
| Parameter | |||
| ConstantParameter | |||
| PositionalParameter | |||