Export (0) Print
Expand All

ParameterInfo.DefaultValue Property

Gets a value indicating the default value if the parameter has a default value.

[Visual Basic]
Public Overridable ReadOnly Property DefaultValue As Object
[C#]
public virtual object DefaultValue {get;}
[C++]
public: __property virtual Object* get_DefaultValue();
[JScript]
public function get DefaultValue() : Object;

Property Value

The default value of the parameter, or Value if the parameter has no default value.

Remarks

The default value is used when an actual value is not specified in the method call. A parameter can have a default value that is a null reference (Nothing in Visual Basic). This is distinct from the case where a default value is not defined.

This method utilizes the DefaultValueImpl method.

To get the ParameterInfo array, first get the method or the constructor and then call MethodBase.GetParameters.

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, .NET Compact Framework

See Also

ParameterInfo Class | ParameterInfo Members | System.Reflection Namespace

Show:
© 2014 Microsoft