Bagikan melalui


Core.OptionalArgumentAttribute Class (F#)

This attribute is added automatically for all optional arguments.

Namespace/Module Path: Microsoft.FSharp.Core

Assembly: FSharp.Core (in FSharp.Core.dll)

[<AttributeUsage(2048, AllowMultiple = false)>]
[<Sealed>]
type OptionalArgumentAttribute =
 class
  new OptionalArgumentAttribute : unit -> OptionalArgumentAttribute
 end

Remarks

You can apply this attribute to a parameter that is an option type to make it an optional parameter. This is the equivalent of applying a ? to the parameter name in the parameter list. Optional parameters should not be followed by non-optional parameters in the parameter list.

You can also use the short form of the name, OptionalArgument.

Constructors

Member

Description

new

Creates an instance of the attribute

Platforms

Windows 7, Windows Vista SP2, Windows XP SP3, Windows XP x64 SP2, Windows Server 2008 R2, Windows Server 2008 SP2, Windows Server 2003 SP2

Version Information

F# Runtime

Supported in: 2.0, 4.0

Silverlight

Supported in: 3

See Also

Reference

Microsoft.FSharp.Core Namespace (F#)