Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

ParameterInfo.DefaultValue Property

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

Namespace: System.Reflection
Assembly: mscorlib (in mscorlib.dll)

public virtual Object DefaultValue { get; }
/** @property */
public Object get_DefaultValue ()

public function get DefaultValue () : Object

Property Value

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

This property is used only in the execution context. In the reflection-only context, use the RawDefaultValue property instead.

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.

Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.

.NET Framework

Supported in: 2.0, 1.1, 1.0

.NET Compact Framework

Supported in: 2.0, 1.0

Community Additions

Show:
© 2014 Microsoft