OptionAttribute 類別

定義

表示命令列選項。 選項會從命令列傳遞為具名參數。

public ref class OptionAttribute : Attribute
[System.AttributeUsage(System.AttributeTargets.Property, AllowMultiple=false, Inherited=false)]
public class OptionAttribute : Attribute
[<System.AttributeUsage(System.AttributeTargets.Property, AllowMultiple=false, Inherited=false)>]
type OptionAttribute = class
    inherit Attribute
Public Class OptionAttribute
Inherits Attribute
繼承
OptionAttribute
屬性

建構函式

OptionAttribute()

表示命令列選項。 選項會從命令列傳遞為具名參數。

屬性

DefaultValue

如果使用者未傳遞此選項的值,則為選擇性的預設值。

Description

針對 選項顯示的說明字串。

Name

選項的名稱。 通常會以前置詞傳遞--. 如果未設定 Name,則會假設宣告屬性的屬性名稱。

ShortName

ShortName 方便起見。 通常會以前置詞傳遞 -。

適用於