ClientBuildManager.GenerateCodeCompileUnit 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
傳回由虛擬路徑表示的檔案之 codeDOM 樹狀、編譯器型別和編譯器參數。
多載
GenerateCodeCompileUnit(String, Type, CompilerParameters, IDictionary) |
傳回由虛擬路徑表示的檔案之 codeDOM 樹狀、編譯器型別和編譯器參數。 |
GenerateCodeCompileUnit(String, String, Type, CompilerParameters, IDictionary) |
傳回由虛擬路徑表示的檔案之內容、codeDOM 樹狀、編譯器型別和編譯器參數。 |
GenerateCodeCompileUnit(String, Type, CompilerParameters, IDictionary)
傳回由虛擬路徑表示的檔案之 codeDOM 樹狀、編譯器型別和編譯器參數。
public:
System::CodeDom::CodeCompileUnit ^ GenerateCodeCompileUnit(System::String ^ virtualPath, [Runtime::InteropServices::Out] Type ^ % codeDomProviderType, [Runtime::InteropServices::Out] System::CodeDom::Compiler::CompilerParameters ^ % compilerParameters, [Runtime::InteropServices::Out] System::Collections::IDictionary ^ % linePragmasTable);
public System.CodeDom.CodeCompileUnit GenerateCodeCompileUnit (string virtualPath, out Type codeDomProviderType, out System.CodeDom.Compiler.CompilerParameters compilerParameters, out System.Collections.IDictionary linePragmasTable);
member this.GenerateCodeCompileUnit : string * Type * CompilerParameters * IDictionary -> System.CodeDom.CodeCompileUnit
Public Function GenerateCodeCompileUnit (virtualPath As String, ByRef codeDomProviderType As Type, ByRef compilerParameters As CompilerParameters, ByRef linePragmasTable As IDictionary) As CodeCompileUnit
參數
- virtualPath
- String
檔案的虛擬路徑。
- codeDomProviderType
- Type
這個方法傳回時,包含用於程式碼產生和編譯的 codeDOM 提供者類型。
- compilerParameters
- CompilerParameters
這個方法傳回時,包含定義如何編譯檔案的屬性。
- linePragmasTable
- IDictionary
這個方法傳回時,包含行 Pragma 的字典。
傳回
指定檔案的 CodeCompileUnit。
備註
GenerateCodeCompileUnit方法會捕獲編譯檔案所需的資訊。 除了做為傳回 CodeCompileUnit 值的物件之外,它還會傳回三個 out
參數。 參數會傳回 codeDomProviderType
產生和編譯檔案的提供者類型。 compilerParameters
參數包含決定編譯行為的屬性。 linePragmasTable
參數包含行 pragma 的字典。
另請參閱
適用於
GenerateCodeCompileUnit(String, String, Type, CompilerParameters, IDictionary)
傳回由虛擬路徑表示的檔案之內容、codeDOM 樹狀、編譯器型別和編譯器參數。
public:
System::CodeDom::CodeCompileUnit ^ GenerateCodeCompileUnit(System::String ^ virtualPath, System::String ^ virtualFileString, [Runtime::InteropServices::Out] Type ^ % codeDomProviderType, [Runtime::InteropServices::Out] System::CodeDom::Compiler::CompilerParameters ^ % compilerParameters, [Runtime::InteropServices::Out] System::Collections::IDictionary ^ % linePragmasTable);
public System.CodeDom.CodeCompileUnit GenerateCodeCompileUnit (string virtualPath, string virtualFileString, out Type codeDomProviderType, out System.CodeDom.Compiler.CompilerParameters compilerParameters, out System.Collections.IDictionary linePragmasTable);
member this.GenerateCodeCompileUnit : string * string * Type * CompilerParameters * IDictionary -> System.CodeDom.CodeCompileUnit
Public Function GenerateCodeCompileUnit (virtualPath As String, virtualFileString As String, ByRef codeDomProviderType As Type, ByRef compilerParameters As CompilerParameters, ByRef linePragmasTable As IDictionary) As CodeCompileUnit
參數
- virtualPath
- String
檔案的虛擬路徑。
- virtualFileString
- String
由 virtualPath
參數表示的檔案之內容。
- codeDomProviderType
- Type
這個方法傳回時,包含用於程式碼產生和編譯的 codeDOM 提供者類型。
- compilerParameters
- CompilerParameters
這個方法傳回時,包含屬性,其定義如何編譯由 virtualPath
參數表示的檔案。
- linePragmasTable
- IDictionary
這個方法傳回時,包含行 Pragma 的字典。
傳回
指定檔案的 CodeCompileUnit。
例外狀況
virtualPath
為 null。
備註
GenerateCodeCompileUnit方法會捕獲編譯檔案所需的資訊。 除了做為傳回 CodeCompileUnit 值的物件之外,它還會傳回三個 out
參數。 參數會傳回 codeDomProviderType
產生和編譯檔案的提供者類型。 compilerParameters
參數包含決定編譯行為的屬性。 linePragmasTable
參數包含行 pragma 的字典。