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引发 。
不应使用 IsUnknowntrue
构造 ,XamlMember除非你的实现可以处理来自 XamlObjectWriter的异常,或者你有其他方法来调整XamlObjectWriter行为。 例如,以下一个或多个实现可能为 true:
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 问题”,并将其取代为新的反馈系统。 有关详细信息,请参阅:提交和查看相关反馈