Class ParameterDescriptor
Descriptor of parameters used in IOverloadableMemberDescriptor implementations.
Inheritance
Inherited Members
Namespace: System.Dynamic.ExpandoObject
Assembly: cs.temp.dll.dll
Syntax
public sealed class ParameterDescriptor : IWireableDescriptor
Constructors
ParameterDescriptor(ParameterInfo)
Initializes a new instance of the ParameterDescriptor class.
Declaration
public ParameterDescriptor(ParameterInfo pi)
Parameters
|
ParameterInfo
pi
A ParameterInfo taken from reflection. |
ParameterDescriptor(String, Type, Boolean, Object, Boolean, Boolean, Boolean)
Initializes a new instance of the ParameterDescriptor class.
Declaration
public ParameterDescriptor(string name, Type type, bool hasDefaultValue = false, object defaultValue = null, bool isOut = false, bool isRef = false, bool isVarArgs = false)
Parameters
|
System.String
name
The name. |
|
Type
type
The type. |
|
System.Boolean
hasDefaultValue
if set to |
|
System.Object
defaultValue
The default value. |
|
System.Boolean
isOut
if set to |
|
System.Boolean
isRef
if set to |
|
System.Boolean
isVarArgs
if set to |
ParameterDescriptor(String, Type, Boolean, Object, Boolean, Boolean, Boolean, Type)
Initializes a new instance of the ParameterDescriptor class.
Declaration
public ParameterDescriptor(string name, Type type, bool hasDefaultValue, object defaultValue, bool isOut, bool isRef, bool isVarArgs, Type typeRestriction)
Parameters
|
System.String
name
The name. |
|
Type
type
The type. |
|
System.Boolean
hasDefaultValue
if set to |
|
System.Object
defaultValue
The default value. |
|
System.Boolean
isOut
if set to |
|
System.Boolean
isRef
if set to |
|
System.Boolean
isVarArgs
if set to |
|
Type
typeRestriction
The type restriction, or nll. |
Properties
DefaultValue
Gets the default value
Declaration
public object DefaultValue { get; }
Property Value
|
System.Object
|
HasBeenRestricted
Gets a value indicating whether this instance has been restricted.
Declaration
public bool HasBeenRestricted { get; }
Property Value
|
System.Boolean
|
HasDefaultValue
Gets a value indicating whether this instance has a default value.
Declaration
public bool HasDefaultValue { get; }
Property Value
|
System.Boolean
|
IsOut
Gets a value indicating whether this instance is an out parameter
Declaration
public bool IsOut { get; }
Property Value
|
System.Boolean
|
IsRef
Gets a value indicating whether this instance is a "ref" parameter
Declaration
public bool IsRef { get; }
Property Value
|
System.Boolean
|
IsVarArgs
Gets a value indicating whether this instance is a variable arguments param
Declaration
public bool IsVarArgs { get; }
Property Value
|
System.Boolean
|
Name
Gets the name of the parameter
Declaration
public string Name { get; }
Property Value
|
System.String
|
OriginalType
Gets the original type of the parameter before any restriction has been applied.
Declaration
public Type OriginalType { get; }
Property Value
|
Type
|
Type
Gets the type of the parameter
Declaration
public Type Type { get; }
Property Value
|
Type
|
Methods
PrepareForWiring(Table)
Prepares the descriptor for hard-wiring. The descriptor fills the passed table with all the needed data for hardwire generators to generate the appropriate code.
Declaration
public void PrepareForWiring(Table table)
Parameters
|
Table
table
|
Implements
RestrictType(Type)
Restricts the type of this parameter to a tighter constraint. Restrictions must be applied before the IOverloadableMemberDescriptor containing this parameter is used in any way.
Declaration
public void RestrictType(Type type)
Parameters
|
Type
type
The new type. |
Exceptions
|
System.InvalidOperationException
Cannot restrict a ref/out or varargs param or Specified operation is not a restriction |
ToString()
Returns a System.String that represents this instance.
Declaration
public override string ToString()
Returns
|
System.String
A System.String that represents this instance. |