ContextAttribute 类 
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
提供 IContextAttribute 和 IContextProperty 接口的默认实现。
此 API 支持产品基础结构,不能在代码中直接使用。
public ref class ContextAttribute : Attribute, System::Runtime::Remoting::Contexts::IContextAttribute, System::Runtime::Remoting::Contexts::IContextProperty[System.AttributeUsage(System.AttributeTargets.Class)]
[System.Serializable]
public class ContextAttribute : Attribute, System.Runtime.Remoting.Contexts.IContextAttribute, System.Runtime.Remoting.Contexts.IContextProperty[System.AttributeUsage(System.AttributeTargets.Class)]
[System.Serializable]
[System.Runtime.InteropServices.ComVisible(true)]
public class ContextAttribute : Attribute, System.Runtime.Remoting.Contexts.IContextAttribute, System.Runtime.Remoting.Contexts.IContextProperty[System.AttributeUsage(System.AttributeTargets.Class)]
[System.Serializable]
[System.Runtime.InteropServices.ComVisible(true)]
[System.Security.SecurityCritical]
public class ContextAttribute : Attribute, System.Runtime.Remoting.Contexts.IContextAttribute, System.Runtime.Remoting.Contexts.IContextProperty[<System.AttributeUsage(System.AttributeTargets.Class)>]
[<System.Serializable>]
type ContextAttribute = class
    inherit Attribute
    interface IContextAttribute
    interface IContextProperty[<System.AttributeUsage(System.AttributeTargets.Class)>]
[<System.Serializable>]
[<System.Runtime.InteropServices.ComVisible(true)>]
type ContextAttribute = class
    inherit Attribute
    interface IContextAttribute
    interface IContextProperty[<System.AttributeUsage(System.AttributeTargets.Class)>]
[<System.Serializable>]
[<System.Runtime.InteropServices.ComVisible(true)>]
[<System.Security.SecurityCritical>]
type ContextAttribute = class
    inherit Attribute
    interface IContextAttribute
    interface IContextPropertyPublic Class ContextAttribute
Inherits Attribute
Implements IContextAttribute, IContextProperty- 继承
- 派生
- 属性
- 实现
注解
类 ContextAttribute 是所有上下文属性的根。 简单 Context 类属性可以通过上下文属性和上下文属性在 类中派生 ContextAttribute 。 对于更专业或更复杂的需求,上下文属性可以从 派生, ContextAttribute 上下文属性可以拆分为单独的类。 有关使用特性的详细信息,请参阅 特性。
继承者说明
Name不得在任何用户派生类中重写 属性。 当前 Equals(Object) 和 GetHashCode() 方法取决于默认功能。 若要为扩展 ContextAttribute 类的类提供高级行为并重写 Name 属性,还必须重写 和 GetHashCode() 方法的默认实现Equals(Object)。
构造函数
| ContextAttribute(String) | 此 API 支持产品基础结构,不能在代码中直接使用。 使用指定的名称创建 ContextAttribute 类的实例。 | 
字段
| AttributeName | 此 API 支持产品基础结构,不能在代码中直接使用。 指示上下文特性的名称。 | 
属性
| Name | 此 API 支持产品基础结构,不能在代码中直接使用。 获取上下文特性的名称。 | 
| TypeId | 此 API 支持产品基础结构,不能在代码中直接使用。 在派生类中实现时,获取此 Attribute 的唯一标识符。(继承自 Attribute) | 
方法
| Equals(Object) | 此 API 支持产品基础结构,不能在代码中直接使用。 返回一个布尔值,该值指示此实例是否与指定的对象相等。 | 
| Freeze(Context) | 此 API 支持产品基础结构,不能在代码中直接使用。 当上下文冻结时调用。 | 
| GetHashCode() | 此 API 支持产品基础结构,不能在代码中直接使用。 返回此 ContextAttribute 实例的哈希代码。 | 
| GetPropertiesForNewContext(IConstructionCallMessage) | 此 API 支持产品基础结构,不能在代码中直接使用。 将当前上下文属性添加到给定的消息。 | 
| GetType() | 此 API 支持产品基础结构,不能在代码中直接使用。 获取当前实例的 Type。(继承自 Object) | 
| IsContextOK(Context, IConstructionCallMessage) | 此 API 支持产品基础结构,不能在代码中直接使用。 返回一个指示该上下文参数是否满足上下文特性要求的布尔值。 | 
| IsDefaultAttribute() | 此 API 支持产品基础结构,不能在代码中直接使用。 在派生类中重写时,指示此实例的值是否是派生类的默认值。(继承自 Attribute) | 
| IsNewContextOK(Context) | 此 API 支持产品基础结构,不能在代码中直接使用。 返回一个指示上下文属性是否与新上下文兼容的布尔值。 | 
| Match(Object) | 此 API 支持产品基础结构,不能在代码中直接使用。 当在派生类中重写时,返回一个指示此实例是否等于指定对象的值。(继承自 Attribute) | 
| MemberwiseClone() | 此 API 支持产品基础结构,不能在代码中直接使用。 创建当前 Object 的浅表副本。(继承自 Object) | 
| ToString() | 此 API 支持产品基础结构,不能在代码中直接使用。 返回表示当前对象的字符串。(继承自 Object) | 
显式接口实现
| _Attribute.GetIDsOfNames(Guid, IntPtr, UInt32, UInt32, IntPtr) | 此 API 支持产品基础结构,不能在代码中直接使用。 将一组名称映射为对应的一组调度标识符。(继承自 Attribute) | 
| _Attribute.GetTypeInfo(UInt32, UInt32, IntPtr) | 此 API 支持产品基础结构,不能在代码中直接使用。 检索对象的类型信息,然后可以使用该信息获取接口的类型信息。(继承自 Attribute) | 
| _Attribute.GetTypeInfoCount(UInt32) | 此 API 支持产品基础结构,不能在代码中直接使用。 检索对象提供的类型信息接口的数量(0 或 1)。(继承自 Attribute) | 
| _Attribute.Invoke(UInt32, Guid, UInt32, Int16, IntPtr, IntPtr, IntPtr, IntPtr) | 此 API 支持产品基础结构,不能在代码中直接使用。 提供对某一对象公开的属性和方法的访问。(继承自 Attribute) |