XamlMember 建構函式
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
初始化 XamlMember 類別的新執行個體。
多載
XamlMember(EventInfo, XamlSchemaContext)
使用 CLR 型別系統 XamlMember 和 EventInfo,初始化 XamlSchemaContext 類別的新執行個體。
public:
XamlMember(System::Reflection::EventInfo ^ eventInfo, System::Xaml::XamlSchemaContext ^ schemaContext);
public XamlMember (System.Reflection.EventInfo eventInfo, System.Xaml.XamlSchemaContext schemaContext);
new System.Xaml.XamlMember : System.Reflection.EventInfo * System.Xaml.XamlSchemaContext -> System.Xaml.XamlMember
Public Sub New (eventInfo As EventInfo, schemaContext As XamlSchemaContext)
參數
- schemaContext
- XamlSchemaContext
用來限定成員的 XamlSchemaContext 內容。
備註
如果成員代表事件 (事件處理常式連接點屬性) ,請使用這個建構函式。
適用於
XamlMember(PropertyInfo, XamlSchemaContext)
使用 CLR 型別系統 XamlMember 和 PropertyInfo,初始化 XamlSchemaContext 類別的新執行個體。
public:
XamlMember(System::Reflection::PropertyInfo ^ propertyInfo, System::Xaml::XamlSchemaContext ^ schemaContext);
public XamlMember (System.Reflection.PropertyInfo propertyInfo, System.Xaml.XamlSchemaContext schemaContext);
new System.Xaml.XamlMember : System.Reflection.PropertyInfo * System.Xaml.XamlSchemaContext -> System.Xaml.XamlMember
Public Sub New (propertyInfo As PropertyInfo, schemaContext As XamlSchemaContext)
參數
- propertyInfo
- PropertyInfo
表示屬性成員的 CLR 型別系統 PropertyInfo。
- schemaContext
- XamlSchemaContext
用來限定成員的 XamlSchemaContext 內容。
備註
如果成員代表屬性 (,特別是不是事件處理常式連接) ,請使用這個建構函式。
適用於
XamlMember(EventInfo, XamlSchemaContext, XamlMemberInvoker)
使用 CLR 型別系統 XamlMember 和 EventInfo (包含 XamlSchemaContext 資訊),初始化 XamlMemberInvoker 類別的新執行個體。
public:
XamlMember(System::Reflection::EventInfo ^ eventInfo, System::Xaml::XamlSchemaContext ^ schemaContext, System::Xaml::Schema::XamlMemberInvoker ^ invoker);
public XamlMember (System.Reflection.EventInfo eventInfo, System.Xaml.XamlSchemaContext schemaContext, System.Xaml.Schema.XamlMemberInvoker invoker);
new System.Xaml.XamlMember : System.Reflection.EventInfo * System.Xaml.XamlSchemaContext * System.Xaml.Schema.XamlMemberInvoker -> System.Xaml.XamlMember
Public Sub New (eventInfo As EventInfo, schemaContext As XamlSchemaContext, invoker As XamlMemberInvoker)
參數
- schemaContext
- XamlSchemaContext
用來限定成員的 XamlSchemaContext 內容。
- invoker
- XamlMemberInvoker
XamlMemberInvoker 實作,可處理對 XamlMember 的執行階段反映呼叫。
備註
如果成員代表事件 (或事件處理常式連接點屬性) ,請使用這個建構函式。
適用於
XamlMember(PropertyInfo, XamlSchemaContext, XamlMemberInvoker)
使用反映 XamlMember 和 PropertyInfo (包含 XamlSchemaContext 資訊),初始化 XamlMemberInvoker 類別的新執行個體。
public:
XamlMember(System::Reflection::PropertyInfo ^ propertyInfo, System::Xaml::XamlSchemaContext ^ schemaContext, System::Xaml::Schema::XamlMemberInvoker ^ invoker);
public XamlMember (System.Reflection.PropertyInfo propertyInfo, System.Xaml.XamlSchemaContext schemaContext, System.Xaml.Schema.XamlMemberInvoker invoker);
new System.Xaml.XamlMember : System.Reflection.PropertyInfo * System.Xaml.XamlSchemaContext * System.Xaml.Schema.XamlMemberInvoker -> System.Xaml.XamlMember
Public Sub New (propertyInfo As PropertyInfo, schemaContext As XamlSchemaContext, invoker As XamlMemberInvoker)
參數
- propertyInfo
- PropertyInfo
表示屬性成員的 CLR 型別系統 PropertyInfo。
- schemaContext
- XamlSchemaContext
用來限定成員的 XamlSchemaContext 內容。
- invoker
- XamlMemberInvoker
XamlMemberInvoker 實作,可處理對 XamlMember 的執行階段叫用呼叫。
備註
只有當成員代表屬性,而且不是事件處理常式連接時,才使用此建構函式。
適用於
XamlMember(String, MethodInfo, XamlSchemaContext)
針對表示可附加事件的 XamlMember,初始化 XamlMember 類別的新執行個體。
public:
XamlMember(System::String ^ attachableEventName, System::Reflection::MethodInfo ^ adder, System::Xaml::XamlSchemaContext ^ schemaContext);
public XamlMember (string attachableEventName, System.Reflection.MethodInfo adder, System.Xaml.XamlSchemaContext schemaContext);
new System.Xaml.XamlMember : string * System.Reflection.MethodInfo * System.Xaml.XamlSchemaContext -> System.Xaml.XamlMember
Public Sub New (attachableEventName As String, adder As MethodInfo, schemaContext As XamlSchemaContext)
參數
- attachableEventName
- String
可附加事件的字串名稱。
- adder
- MethodInfo
可附加成員之支援實作的處理常式 Add
方法的 CLR 型別系統 MethodInfo。
- schemaContext
- XamlSchemaContext
用來限定成員的 XamlSchemaContext 內容。
備註
如果成員代表可附加的事件成員,請使用這個建構函式。
適用於
XamlMember(String, XamlType, Boolean)
使用字串名稱並宣告 XamlMember 資訊,初始化 XamlType 類別的新執行個體。 使用此簽章建構的 XamlMember 具有諸多限制。
public:
XamlMember(System::String ^ name, System::Xaml::XamlType ^ declaringType, bool isAttachable);
public XamlMember (string name, System.Xaml.XamlType declaringType, bool isAttachable);
new System.Xaml.XamlMember : string * System.Xaml.XamlType * bool -> System.Xaml.XamlMember
Public Sub New (name As String, declaringType As XamlType, isAttachable As Boolean)
參數
- name
- String
成員的字串名稱。
- isAttachable
- Boolean
true
表示成員為可附加成員,否則為 false
。
例外狀況
name
或 declaringType
為 null
。
備註
XamlMember,使用 簽章所建構的 XamlMember(String, XamlType, Boolean) ,會 true
傳回 。 IsUnknown
對於涉及 XamlObjectWriter 的載入路徑,這類成員無法寫入物件圖形中。 使用 .NET Framework XAML 服務實作時, XamlObjectWriter.WriteStartMember 呼叫會在 的相關 XamlMember 報表 true
時 IsUnknown 擲回 XamlObjectWriterException 。
除非您的實作可以處理 來自 XamlObjectWriter 的例外狀況,否則您不應該建構 true
IsUnknownXamlMember ,或者您有其他方法來調整 XamlObjectWriter 行為。 例如,您的實作可能會有下列一或多個情況:
XAML 架構內容稍後可供使用。
您可以使用成員叫用程式模式。
您刻意在自訂 XAML 寫入器中覆寫 XamlObjectWriter.WriteStartMember 。
適用於
XamlMember(String, MethodInfo, MethodInfo, XamlSchemaContext)
針對表示可附加屬性的 XamlMember,初始化 XamlMember 類別的新執行個體。
public:
XamlMember(System::String ^ attachablePropertyName, System::Reflection::MethodInfo ^ getter, System::Reflection::MethodInfo ^ setter, System::Xaml::XamlSchemaContext ^ schemaContext);
public XamlMember (string attachablePropertyName, System.Reflection.MethodInfo getter, System.Reflection.MethodInfo setter, System.Xaml.XamlSchemaContext schemaContext);
new System.Xaml.XamlMember : string * System.Reflection.MethodInfo * System.Reflection.MethodInfo * System.Xaml.XamlSchemaContext -> System.Xaml.XamlMember
Public Sub New (attachablePropertyName As String, getter As MethodInfo, setter As MethodInfo, schemaContext As XamlSchemaContext)
參數
- attachablePropertyName
- String
可附加屬性的字串名稱。
- getter
- MethodInfo
可附加成員之支援實作的 get
存取子的 CLR 型別系統 MethodInfo。
- setter
- MethodInfo
可附加成員之支援實作的 set
存取子的 CLR 型別系統 MethodInfo。
- schemaContext
- XamlSchemaContext
用來限定成員的 XamlSchemaContext 內容。
備註
如果成員代表可附加屬性,請使用這個建構函式。
適用於
XamlMember(String, MethodInfo, XamlSchemaContext, XamlMemberInvoker)
針對表示可附加事件的 XamlMember (包含 XamlMember 資訊),初始化 XamlMemberInvoker 類別的新執行個體。
public:
XamlMember(System::String ^ attachableEventName, System::Reflection::MethodInfo ^ adder, System::Xaml::XamlSchemaContext ^ schemaContext, System::Xaml::Schema::XamlMemberInvoker ^ invoker);
public XamlMember (string attachableEventName, System.Reflection.MethodInfo adder, System.Xaml.XamlSchemaContext schemaContext, System.Xaml.Schema.XamlMemberInvoker invoker);
new System.Xaml.XamlMember : string * System.Reflection.MethodInfo * System.Xaml.XamlSchemaContext * System.Xaml.Schema.XamlMemberInvoker -> System.Xaml.XamlMember
Public Sub New (attachableEventName As String, adder As MethodInfo, schemaContext As XamlSchemaContext, invoker As XamlMemberInvoker)
參數
- attachableEventName
- String
可附加事件的字串名稱。
- adder
- MethodInfo
可附加成員之支援實作的處理常式 Add
方法的 CLR 型別系統 MethodInfo。
- schemaContext
- XamlSchemaContext
用來限定成員的 XamlSchemaContext 內容。
- invoker
- XamlMemberInvoker
XamlMemberInvoker 實作,可處理對 XamlMember 的執行階段叫用呼叫。
備註
如果成員代表可附加的事件成員,請使用這個建構函式。
適用於
XamlMember(String, MethodInfo, MethodInfo, XamlSchemaContext, XamlMemberInvoker)
針對表示可附加屬性的 XamlMember (包含 XamlMember 資訊),初始化 XamlMemberInvoker 類別的新執行個體。
public:
XamlMember(System::String ^ attachablePropertyName, System::Reflection::MethodInfo ^ getter, System::Reflection::MethodInfo ^ setter, System::Xaml::XamlSchemaContext ^ schemaContext, System::Xaml::Schema::XamlMemberInvoker ^ invoker);
public XamlMember (string attachablePropertyName, System.Reflection.MethodInfo getter, System.Reflection.MethodInfo setter, System.Xaml.XamlSchemaContext schemaContext, System.Xaml.Schema.XamlMemberInvoker invoker);
new System.Xaml.XamlMember : string * System.Reflection.MethodInfo * System.Reflection.MethodInfo * System.Xaml.XamlSchemaContext * System.Xaml.Schema.XamlMemberInvoker -> System.Xaml.XamlMember
Public Sub New (attachablePropertyName As String, getter As MethodInfo, setter As MethodInfo, schemaContext As XamlSchemaContext, invoker As XamlMemberInvoker)
參數
- attachablePropertyName
- String
可附加屬性的字串名稱。
- getter
- MethodInfo
可附加成員之支援實作的 get
存取子的 CLR 型別系統 MethodInfo。
- setter
- MethodInfo
可附加成員之支援實作的 set
存取子的 CLR 型別系統 MethodInfo。
- schemaContext
- XamlSchemaContext
用來限定成員的 XamlSchemaContext 內容。
- invoker
- XamlMemberInvoker
XamlMemberInvoker 實作,可處理對 XamlMember 的執行階段叫用呼叫。
備註
如果成員代表可附加的屬性成員,請使用這個建構函式。
適用於
意見反應
https://aka.ms/ContentUserFeedback。
即將登場:在 2024 年,我們將逐步淘汰 GitHub 問題作為內容的意見反應機制,並將它取代為新的意見反應系統。 如需詳細資訊,請參閱:提交並檢視相關的意見反應