XamlType 建構函式
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
初始化 XamlType 類別的新執行個體。
多載
| 名稱 | Description |
|---|---|
| XamlType(Type, XamlSchemaContext) |
根據底層 CLR 類型資訊初始化該 XamlType 類別的新實例。 |
| XamlType(String, IList<XamlType>, XamlSchemaContext) |
根據該型別的字串名稱初始化類別 XamlType 的新實例。 |
| XamlType(Type, XamlSchemaContext, XamlTypeInvoker) |
根據底層型別資訊與XamlTypeInvoker實作初始化該XamlType類別的新實例。 |
| XamlType(String, String, IList<XamlType>, XamlSchemaContext) |
根據 XAML 命名空間及型別的字串名稱初始化該 XamlType 類別的新實例。 此建構器專門用於分析及 XAML 節點記錄在支援型別系統及 XAML 架構上下文中缺乏支持的型別使用。 |
XamlType(Type, XamlSchemaContext)
根據底層 CLR 類型資訊初始化該 XamlType 類別的新實例。
public:
XamlType(Type ^ underlyingType, System::Xaml::XamlSchemaContext ^ schemaContext);
public XamlType(Type underlyingType, System.Xaml.XamlSchemaContext schemaContext);
new System.Xaml.XamlType : Type * System.Xaml.XamlSchemaContext -> System.Xaml.XamlType
Public Sub New (underlyingType As Type, schemaContext As XamlSchemaContext)
參數
- schemaContext
- XamlSchemaContext
XAML 讀卡器或 XAML 寫入器的 XAML 結構上下文。
例外狀況
一個或多個 或 underlyingTypeschemaContext 是 null。
適用於
XamlType(String, IList<XamlType>, XamlSchemaContext)
根據該型別的字串名稱初始化類別 XamlType 的新實例。
protected:
XamlType(System::String ^ typeName, System::Collections::Generic::IList<System::Xaml::XamlType ^> ^ typeArguments, System::Xaml::XamlSchemaContext ^ schemaContext);
protected XamlType(string typeName, System.Collections.Generic.IList<System.Xaml.XamlType> typeArguments, System.Xaml.XamlSchemaContext schemaContext);
new System.Xaml.XamlType : string * System.Collections.Generic.IList<System.Xaml.XamlType> * System.Xaml.XamlSchemaContext -> System.Xaml.XamlType
Protected Sub New (typeName As String, typeArguments As IList(Of XamlType), schemaContext As XamlSchemaContext)
參數
- typeName
- String
要創造的類型名稱。
- schemaContext
- XamlSchemaContext
XAML 讀卡器與 XAML 寫入器的結構上下文。
例外狀況
一個或多個 或 typeNameschemaContext 是 null。
備註
這是受保護的建造者。 目前尚無使用此特定路徑建構的公開衍生類別。 作為現有 XamlType的使用者,你必須使用其他建構子簽名(XamlType(Type, XamlSchemaContext, XamlTypeInvoker), , XamlType(Type, XamlSchemaContext)或 XamlType(String, String, IList<XamlType>, XamlSchemaContext))來初始化物件 XamlType 。
適用於
XamlType(Type, XamlSchemaContext, XamlTypeInvoker)
根據底層型別資訊與XamlTypeInvoker實作初始化該XamlType類別的新實例。
public:
XamlType(Type ^ underlyingType, System::Xaml::XamlSchemaContext ^ schemaContext, System::Xaml::Schema::XamlTypeInvoker ^ invoker);
public XamlType(Type underlyingType, System.Xaml.XamlSchemaContext schemaContext, System.Xaml.Schema.XamlTypeInvoker invoker);
new System.Xaml.XamlType : Type * System.Xaml.XamlSchemaContext * System.Xaml.Schema.XamlTypeInvoker -> System.Xaml.XamlType
Public Sub New (underlyingType As Type, schemaContext As XamlSchemaContext, invoker As XamlTypeInvoker)
參數
- underlyingType
- Type
XAML 型態要構造的底層型別。
- schemaContext
- XamlSchemaContext
XAML 讀取器的 XAML 架構上下文。
- invoker
- XamlTypeInvoker
XamlTypeInvoker處理執行時反射的實作會呼叫 XamlType。
例外狀況
一個或多個 或 underlyingTypeschemaContext 是 null。
適用於
XamlType(String, String, IList<XamlType>, XamlSchemaContext)
根據 XAML 命名空間及型別的字串名稱初始化該 XamlType 類別的新實例。 此建構器專門用於分析及 XAML 節點記錄在支援型別系統及 XAML 架構上下文中缺乏支持的型別使用。
public:
XamlType(System::String ^ unknownTypeNamespace, System::String ^ unknownTypeName, System::Collections::Generic::IList<System::Xaml::XamlType ^> ^ typeArguments, System::Xaml::XamlSchemaContext ^ schemaContext);
public XamlType(string unknownTypeNamespace, string unknownTypeName, System.Collections.Generic.IList<System.Xaml.XamlType> typeArguments, System.Xaml.XamlSchemaContext schemaContext);
new System.Xaml.XamlType : string * string * System.Collections.Generic.IList<System.Xaml.XamlType> * System.Xaml.XamlSchemaContext -> System.Xaml.XamlType
Public Sub New (unknownTypeNamespace As String, unknownTypeName As String, typeArguments As IList(Of XamlType), schemaContext As XamlSchemaContext)
參數
- unknownTypeNamespace
- String
XAML 命名空間,作為字串。
- unknownTypeName
- String
在所提供的 unknownTypeNamespace XAML 命名空間中,該型別的名稱。
- schemaContext
- XamlSchemaContext
XAML 讀卡器或 XAML 寫入器的 XAML 結構上下文。
例外狀況
一個或多個 、 unknownTypeNamespaceunknownTypeName、 schemaContext 或 是 null。
備註
此建構器僅用於無法使用可映射至底層類型系統的「未知」型態。 此構造子可能不會產生 的結果,其中 XamlType.IsUnknown 為 true。 預設反射器邏輯會將底層類型回報為 XamlLanguage.Object。 然而,這種行為可能會因為覆 LookupIsUnknown 寫而改變。