Class ConstructionAttribute
Attribute that can be attached to a constructor or factory method, to provide information about
how to set the parameters of the constructor/method to copy an instance of the object.
For example, it can indicate that the parameters correspond to properties of the object.
Inheritance
ConstructionAttribute
Assembly: Microsoft.ML.Probabilistic.dll
Syntax
[AttributeUsage(AttributeTargets.Constructor | AttributeTargets.Method)]
public class ConstructionAttribute : Attribute, IComparable
Constructors
ConstructionAttribute()
Declaration
public ConstructionAttribute()
ConstructionAttribute(String[])
Declaration
public ConstructionAttribute(params string[] parameters)
Parameters
Type |
Name |
Description |
String[] |
parameters |
|
Fields
TargetMember
Declaration
public MemberInfo TargetMember
Field Value
Properties
Params
The names of the properties, fields or methods to call on an object instance
to get parameter values to construct a duplicate of that instance.
Declaration
public string[] Params { get; }
Property Value
UseWhen
The name of a boolean property or method on the object instance which
indicates when this construction method should be used.
Declaration
public string UseWhen { get; set; }
Property Value
Methods
CompareTo(Object)
Declaration
public int CompareTo(object obj)
Parameters
Type |
Name |
Description |
Object |
obj |
|
Returns
GetConstructionAttribute(Type)
Declaration
public static List<ConstructionAttribute> GetConstructionAttribute(Type type)
Parameters
Type |
Name |
Description |
Type |
type |
|
Returns
GetParamValue(Int32, Object, out Type)
Gets the value of the constructor parameter at the given index needed to
reconstruct the supplied instance.
Declaration
public object GetParamValue(int paramIndex, object instance, out Type type)
Parameters
Type |
Name |
Description |
Int32 |
paramIndex |
The parameter index
|
Object |
instance |
The instance
|
Type |
type |
Type of the parameter (output)
|
Returns
Implements