ContextAttribute ContextAttribute ContextAttribute ContextAttribute Class

Definition

Provides the default implementations of the IContextAttribute and IContextProperty interfaces.

This API supports the product infrastructure and is not intended to be used directly from your code.

public ref class ContextAttribute : Attribute, System::Runtime::Remoting::Contexts::IContextAttribute, System::Runtime::Remoting::Contexts::IContextProperty
[System.AttributeUsage(System.AttributeTargets.Class)]
[System.Runtime.InteropServices.ComVisible(true)]
[System.Security.SecurityCritical]
[System.Serializable]
public class ContextAttribute : Attribute, System.Runtime.Remoting.Contexts.IContextAttribute, System.Runtime.Remoting.Contexts.IContextProperty
type ContextAttribute = class
    inherit Attribute
    interface IContextAttribute
    interface IContextProperty
Public Class ContextAttribute
Inherits Attribute
Implements IContextAttribute, IContextProperty
Inheritance
ContextAttributeContextAttributeContextAttributeContextAttribute
Derived
Attributes
Implements

Remarks

The ContextAttribute class is the root for all context attributes. Simple Context class properties can be derived from ContextAttribute with the context attribute and the context property being in the class. For more specialized or more sophisticated needs, the context attribute can derive from ContextAttribute and the context property can be split into a separated class. For more information about using attributes, see Attributes.

Notes to Inheritors

The Name property must not be overridden in any user derived class. The current Equals(Object) and GetHashCode() methods depend on the default functionality. To provide advanced behavior for a class extending the ContextAttribute class and override the Name property, you also have to override the default implementation of the Equals(Object) and GetHashCode() methods.

Constructors

ContextAttribute(String) ContextAttribute(String) ContextAttribute(String) ContextAttribute(String)

Creates an instance of the ContextAttribute class with the specified name.

Fields

AttributeName AttributeName AttributeName AttributeName

Indicates the name of the context attribute.

Properties

Name Name Name Name

Gets the name of the context attribute.

TypeId TypeId TypeId TypeId

When implemented in a derived class, gets a unique identifier for this Attribute.

(Inherited from Attribute)

Methods

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

Returns a Boolean value indicating whether this instance is equal to the specified object.

Freeze(Context) Freeze(Context) Freeze(Context) Freeze(Context)

Called when the context is frozen.

GetHashCode() GetHashCode() GetHashCode() GetHashCode()

Returns the hashcode for this instance of ContextAttribute.

GetPropertiesForNewContext(IConstructionCallMessage) GetPropertiesForNewContext(IConstructionCallMessage) GetPropertiesForNewContext(IConstructionCallMessage) GetPropertiesForNewContext(IConstructionCallMessage)

Adds the current context property to the given message.

GetType() GetType() GetType() GetType()

Gets the Type of the current instance.

(Inherited from Object)
IsContextOK(Context, IConstructionCallMessage) IsContextOK(Context, IConstructionCallMessage) IsContextOK(Context, IConstructionCallMessage) IsContextOK(Context, IConstructionCallMessage)

Returns a Boolean value indicating whether the context parameter meets the context attribute's requirements.

IsDefaultAttribute() IsDefaultAttribute() IsDefaultAttribute() IsDefaultAttribute()

When overridden in a derived class, indicates whether the value of this instance is the default value for the derived class.

(Inherited from Attribute)
IsNewContextOK(Context) IsNewContextOK(Context) IsNewContextOK(Context) IsNewContextOK(Context)

Returns a Boolean value indicating whether the context property is compatible with the new context.

Match(Object) Match(Object) Match(Object) Match(Object)

When overridden in a derived class, returns a value that indicates whether this instance equals a specified object.

(Inherited from Attribute)
MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

Creates a shallow copy of the current Object.

(Inherited from Object)
ToString() ToString() ToString() ToString()

Returns a string that represents the current object.

(Inherited from Object)

Explicit Interface Implementations

_Attribute.GetIDsOfNames(Guid, IntPtr, UInt32, UInt32, IntPtr) _Attribute.GetIDsOfNames(Guid, IntPtr, UInt32, UInt32, IntPtr) _Attribute.GetIDsOfNames(Guid, IntPtr, UInt32, UInt32, IntPtr) _Attribute.GetIDsOfNames(Guid, IntPtr, UInt32, UInt32, IntPtr)

Maps a set of names to a corresponding set of dispatch identifiers.

(Inherited from Attribute)
_Attribute.GetTypeInfo(UInt32, UInt32, IntPtr) _Attribute.GetTypeInfo(UInt32, UInt32, IntPtr) _Attribute.GetTypeInfo(UInt32, UInt32, IntPtr) _Attribute.GetTypeInfo(UInt32, UInt32, IntPtr)

Retrieves the type information for an object, which can be used to get the type information for an interface.

(Inherited from Attribute)
_Attribute.GetTypeInfoCount(UInt32) _Attribute.GetTypeInfoCount(UInt32) _Attribute.GetTypeInfoCount(UInt32) _Attribute.GetTypeInfoCount(UInt32)

Retrieves the number of type information interfaces that an object provides (either 0 or 1).

(Inherited from Attribute)
_Attribute.Invoke(UInt32, Guid, UInt32, Int16, IntPtr, IntPtr, IntPtr, IntPtr) _Attribute.Invoke(UInt32, Guid, UInt32, Int16, IntPtr, IntPtr, IntPtr, IntPtr) _Attribute.Invoke(UInt32, Guid, UInt32, Int16, IntPtr, IntPtr, IntPtr, IntPtr) _Attribute.Invoke(UInt32, Guid, UInt32, Int16, IntPtr, IntPtr, IntPtr, IntPtr)

Provides access to properties and methods exposed by an object.

(Inherited from Attribute)

Applies to