Core.AutoOpenAttribute 類別 (F#)
這個屬性有兩種用途。 套用到組件時,必須授與它一個字串引數,且此引數必須指出該組件中的有效模組或命名空間。 使用此組件的參考所編譯的原始程式碼檔會在自動開啟指定路徑的環境中處理。
**命名空間/模組路徑:**Microsoft.FSharp.Core
組件:FSharp.Core (在 FSharp.Core.dll 中)
[<AttributeUsage(AttributeTargets.Class ||| AttributeTargets.Assembly, AllowMultiple = true)>] [<Sealed>] type AutoOpenAttribute = class new AutoOpenAttribute : string -> AutoOpenAttribute new AutoOpenAttribute : unit -> AutoOpenAttribute member this.Path : string end
備註
將屬性套用到組件內的模組時,不得授與任何引數給屬性。 在使用者原始程式碼中開啟封入的命名空間時,也會隱含地開啟模組。
您也可以使用名稱的簡短形式,例如 AutoOpen。
建構函式
成員 |
描述 |
---|---|
建立用來使命名空間或模組路徑在參考組件時自動開啟的屬性。 |
執行個體成員
成員 |
描述 |
---|---|
指出參考組件或封入的模組開啟時要自動開啟的命名空間或模組。 |
平台
Windows 8、Windows 7、Windows Server 2012、Windows Server 2008 R2
版本資訊
F# 核心程式庫版本
支援:2.0、4.0、可攜式