This documentation is archived and is not being maintained.

OptionalAttribute Class

Indicates that a parameter is optional.

For a list of all members of this type, see OptionalAttribute Members.

System.Object
   System.Attribute
      System.Runtime.InteropServices.OptionalAttribute

[Visual Basic]
<AttributeUsage(AttributeTargets.Parameter)>
NotInheritable Public Class OptionalAttribute
   Inherits Attribute
[C#]
[AttributeUsage(AttributeTargets.Parameter)]
public sealed class OptionalAttribute : Attribute
[C++]
[AttributeUsage(AttributeTargets::Parameter)]
public __gc __sealed class OptionalAttribute : public Attribute
[JScript]
public
   AttributeUsage(AttributeTargets.Parameter)
class OptionalAttribute extends Attribute

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Remarks

You can apply this attribute to parameters.

Optional parameters are not supported by all languages.

Requirements

Namespace: System.Runtime.InteropServices

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

Assembly: Mscorlib (in Mscorlib.dll)

See Also

OptionalAttribute Members | System.Runtime.InteropServices Namespace

Show: