共用方式為


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

建構函式

成員

描述

new

建立屬性,這個屬性用來將命名空間或模組路徑標示為在參考組件時自動開啟

執行個體成員

成員

描述

路徑

表示在參考組件或開啟封入模組時要自動開啟的命名空間或模組。

平台

Windows 8 中, Windows 7, Windows Server 2012 上, Windows Server 2008 R2

版本資訊

F# 核心程式庫版本

支援版本:2.0, 4.0,可攜式執行檔 (PE)。

請參閱

參考

Microsoft.FSharp.Core 命名空間 (F#)