Export (0) Print
Expand All

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

Not applicable.

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 Server 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 Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0, 1.1, 1.0

.NET Compact Framework

Supported in: 2.0, 1.0

XNA Framework

Supported in: 1.0

Community Additions

ADD
Show:
© 2014 Microsoft