StronglyTypedResourceBuilder.Create 方法

定義

產生類別檔案,其中包含與輸入參數中指定之資源相符的強型別屬性。

多載

Create(IDictionary, String, String, CodeDomProvider, Boolean, String[])

產生一個類別檔案,而其包含符合指定集合中所參考之資源的強型別屬性。

Create(String, String, String, CodeDomProvider, Boolean, String[])

產生類別檔案,其中包含與指定 .resx 檔案中之資源相符的強型別屬性。

Create(IDictionary, String, String, String, CodeDomProvider, Boolean, String[])

產生一個類別檔案,而其包含符合指定集合中所參考之資源的強型別屬性。

Create(String, String, String, String, CodeDomProvider, Boolean, String[])

產生類別檔案,其中包含與指定 .resx 檔案中之資源相符的強型別屬性。

Create(IDictionary, String, String, CodeDomProvider, Boolean, String[])

產生一個類別檔案,而其包含符合指定集合中所參考之資源的強型別屬性。

public:
 static System::CodeDom::CodeCompileUnit ^ Create(System::Collections::IDictionary ^ resourceList, System::String ^ baseName, System::String ^ generatedCodeNamespace, System::CodeDom::Compiler::CodeDomProvider ^ codeProvider, bool internalClass, [Runtime::InteropServices::Out] cli::array <System::String ^> ^ % unmatchable);
public static System.CodeDom.CodeCompileUnit Create (System.Collections.IDictionary resourceList, string baseName, string generatedCodeNamespace, System.CodeDom.Compiler.CodeDomProvider codeProvider, bool internalClass, out string[] unmatchable);
public static System.CodeDom.CodeCompileUnit Create (System.Collections.IDictionary resourceList, string baseName, string? generatedCodeNamespace, System.CodeDom.Compiler.CodeDomProvider codeProvider, bool internalClass, out string[]? unmatchable);
static member Create : System.Collections.IDictionary * string * string * System.CodeDom.Compiler.CodeDomProvider * bool * String[] -> System.CodeDom.CodeCompileUnit
Public Shared Function Create (resourceList As IDictionary, baseName As String, generatedCodeNamespace As String, codeProvider As CodeDomProvider, internalClass As Boolean, ByRef unmatchable As String()) As CodeCompileUnit

參數

resourceList
IDictionary

IDictionary 集合,其中每個字典項目成對的索引鍵/值組,是資源的名稱與資源的值。

baseName
String

要產生的類別名稱。

generatedCodeNamespace
String

要產生的類別命名空間。

codeProvider
CodeDomProvider

CodeDomProvider 類別,提供將產生之類別的語言。

internalClass
Boolean

若要產生內部類別為 true;若要產生公用類別則為 false

unmatchable
String[]

陣列,其包含無法產生屬性的每個資源名稱。 一般而言,因為資源名稱不是有效的識別碼,所以無法產生屬性。

傳回

CodeCompileUnit 容器。

例外狀況

resourceListbasenamecodeProvidernull

資源節點名稱與 resourceList 中的其索引鍵不相符。

備註

Create使用 方法來產生提供強型別唯讀包裝函式的類別,以存取 參數中包含的resourceList資源。

類別 StronglyTypedResourceBuilder 會忽略開頭為 「$」 或 「>>字元的任何資源名稱。 資源名稱 「Culture」 和 「ResourceManager」 是無效的識別碼。

適用於

Create(String, String, String, CodeDomProvider, Boolean, String[])

產生類別檔案,其中包含與指定 .resx 檔案中之資源相符的強型別屬性。

public:
 static System::CodeDom::CodeCompileUnit ^ Create(System::String ^ resxFile, System::String ^ baseName, System::String ^ generatedCodeNamespace, System::CodeDom::Compiler::CodeDomProvider ^ codeProvider, bool internalClass, [Runtime::InteropServices::Out] cli::array <System::String ^> ^ % unmatchable);
public static System.CodeDom.CodeCompileUnit Create (string resxFile, string baseName, string generatedCodeNamespace, System.CodeDom.Compiler.CodeDomProvider codeProvider, bool internalClass, out string[] unmatchable);
public static System.CodeDom.CodeCompileUnit Create (string resxFile, string baseName, string? generatedCodeNamespace, System.CodeDom.Compiler.CodeDomProvider codeProvider, bool internalClass, out string[]? unmatchable);
static member Create : string * string * string * System.CodeDom.Compiler.CodeDomProvider * bool * String[] -> System.CodeDom.CodeCompileUnit
Public Shared Function Create (resxFile As String, baseName As String, generatedCodeNamespace As String, codeProvider As CodeDomProvider, internalClass As Boolean, ByRef unmatchable As String()) As CodeCompileUnit

參數

resxFile
String

當做輸入的 .resx 檔案名稱。

baseName
String

要產生的類別名稱。

generatedCodeNamespace
String

要產生的類別命名空間。

codeProvider
CodeDomProvider

CodeDomProvider 類別,提供將產生之類別的語言。

internalClass
Boolean

若要產生內部類別為 true;若要產生公用類別則為 false

unmatchable
String[]

String 陣列,其包含無法產生屬性的每個資源名稱。 一般而言,因為資源名稱不是有效的識別碼,所以無法產生屬性。

傳回

CodeCompileUnit 容器。

例外狀況

basenamecodeProvidernull

備註

Create使用 方法來產生類別,以提供參數中resxFile所含資源的強型別、唯讀存取權。

類別 StronglyTypedResourceBuilder 會忽略開頭為 「$」 或 「>>字元的任何資源名稱。 資源名稱 「Culture」 和 「ResourceManager」 是無效的識別碼。

適用於

Create(IDictionary, String, String, String, CodeDomProvider, Boolean, String[])

產生一個類別檔案,而其包含符合指定集合中所參考之資源的強型別屬性。

public:
 static System::CodeDom::CodeCompileUnit ^ Create(System::Collections::IDictionary ^ resourceList, System::String ^ baseName, System::String ^ generatedCodeNamespace, System::String ^ resourcesNamespace, System::CodeDom::Compiler::CodeDomProvider ^ codeProvider, bool internalClass, [Runtime::InteropServices::Out] cli::array <System::String ^> ^ % unmatchable);
public static System.CodeDom.CodeCompileUnit Create (System.Collections.IDictionary resourceList, string baseName, string generatedCodeNamespace, string resourcesNamespace, System.CodeDom.Compiler.CodeDomProvider codeProvider, bool internalClass, out string[] unmatchable);
public static System.CodeDom.CodeCompileUnit Create (System.Collections.IDictionary resourceList, string baseName, string? generatedCodeNamespace, string? resourcesNamespace, System.CodeDom.Compiler.CodeDomProvider codeProvider, bool internalClass, out string[]? unmatchable);
static member Create : System.Collections.IDictionary * string * string * string * System.CodeDom.Compiler.CodeDomProvider * bool * String[] -> System.CodeDom.CodeCompileUnit
Public Shared Function Create (resourceList As IDictionary, baseName As String, generatedCodeNamespace As String, resourcesNamespace As String, codeProvider As CodeDomProvider, internalClass As Boolean, ByRef unmatchable As String()) As CodeCompileUnit

參數

resourceList
IDictionary

IDictionary 集合,其中每個字典項目成對的索引鍵/值組,是資源的名稱與資源的值。

baseName
String

要產生的類別名稱。

generatedCodeNamespace
String

要產生的類別命名空間。

resourcesNamespace
String

要產生的資源命名空間。

codeProvider
CodeDomProvider

CodeDomProvider 物件,提供將產生之類別的語言。

internalClass
Boolean

若要產生內部類別為 true;若要產生公用類別則為 false

unmatchable
String[]

String 陣列,其包含無法產生屬性的每個資源名稱。 一般而言,因為資源名稱不是有效的識別碼,所以無法產生屬性。

傳回

CodeCompileUnit 容器。

例外狀況

resourceListbasenamecodeProvidernull

資源節點名稱與 resourceList 中的其索引鍵不相符。

備註

此多載可讓您使用 resourcesNamespace 參數來指定所產生資源的命名空間。 在此情況下,產生的程式代碼如下所示:

System.Resources.ResourceManager rm = new System.Resources.ResourceManager("<resourceNamespace>.<baseName>",typeof(baseName).Assembly);

在大部分情況下,您不需要從應用程式程式代碼呼叫此方法。

類別 StronglyTypedResourceBuilder 會忽略開頭為 「$」 或 「>>字元的任何資源名稱。 資源名稱 「Culture」 和 「ResourceManager」 是無效的識別碼。

適用於

Create(String, String, String, String, CodeDomProvider, Boolean, String[])

產生類別檔案,其中包含與指定 .resx 檔案中之資源相符的強型別屬性。

public:
 static System::CodeDom::CodeCompileUnit ^ Create(System::String ^ resxFile, System::String ^ baseName, System::String ^ generatedCodeNamespace, System::String ^ resourcesNamespace, System::CodeDom::Compiler::CodeDomProvider ^ codeProvider, bool internalClass, [Runtime::InteropServices::Out] cli::array <System::String ^> ^ % unmatchable);
public static System.CodeDom.CodeCompileUnit Create (string resxFile, string baseName, string generatedCodeNamespace, string resourcesNamespace, System.CodeDom.Compiler.CodeDomProvider codeProvider, bool internalClass, out string[] unmatchable);
public static System.CodeDom.CodeCompileUnit Create (string resxFile, string baseName, string? generatedCodeNamespace, string? resourcesNamespace, System.CodeDom.Compiler.CodeDomProvider codeProvider, bool internalClass, out string[]? unmatchable);
static member Create : string * string * string * string * System.CodeDom.Compiler.CodeDomProvider * bool * String[] -> System.CodeDom.CodeCompileUnit
Public Shared Function Create (resxFile As String, baseName As String, generatedCodeNamespace As String, resourcesNamespace As String, codeProvider As CodeDomProvider, internalClass As Boolean, ByRef unmatchable As String()) As CodeCompileUnit

參數

resxFile
String

當做輸入的 .resx 檔案名稱。

baseName
String

要產生的類別名稱。

generatedCodeNamespace
String

要產生的類別命名空間。

resourcesNamespace
String

要產生的資源命名空間。

codeProvider
CodeDomProvider

CodeDomProvider 類別,提供將產生之類別的語言。

internalClass
Boolean

若要產生內部類別為 true;若要產生公用類別則為 false

unmatchable
String[]

String 陣列,其包含無法產生屬性的每個資源名稱。 一般而言,因為資源名稱不是有效的識別碼,所以無法產生屬性。

傳回

CodeCompileUnit 容器。

例外狀況

basenamecodeProvidernull

備註

Create使用 方法來產生類別,以提供參數中resxFile所含資源的強型別、唯讀存取權。

類別 StronglyTypedResourceBuilder 會忽略開頭為 「$」 或 「>>字元的任何資源名稱。 資源名稱 「Culture」 和 「ResourceManager」 是無效的識別碼。

適用於