Click to Rate and Give Feedback
MSDN
MSDN Library
.NET Development
.NET Framework 3.5
Collapse All/Expand All Collapse All
This page is specific to
Microsoft Visual Studio 2008/.NET Framework 3.5

Other versions are also available for the following:
.NET Framework Class Library
ContextAttribute Class

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

Provides the default implementations of the IContextAttribute and IContextProperty interfaces.

Namespace:  System.Runtime.Remoting.Contexts
Assembly:  mscorlib (in mscorlib.dll)
Visual Basic (Declaration)
<SerializableAttribute> _
<ComVisibleAttribute(True)> _
<AttributeUsageAttribute(AttributeTargets.Class)> _
<SecurityPermissionAttribute(SecurityAction.LinkDemand, Flags := SecurityPermissionFlag.Infrastructure)> _
<SecurityPermissionAttribute(SecurityAction.InheritanceDemand, Flags := SecurityPermissionFlag.Infrastructure)> _
Public Class ContextAttribute _
    Inherits Attribute _
    Implements IContextAttribute, IContextProperty
Visual Basic (Usage)
Dim instance As ContextAttribute
C#
[SerializableAttribute]
[ComVisibleAttribute(true)]
[AttributeUsageAttribute(AttributeTargets.Class)]
[SecurityPermissionAttribute(SecurityAction.LinkDemand, Flags = SecurityPermissionFlag.Infrastructure)]
[SecurityPermissionAttribute(SecurityAction.InheritanceDemand, Flags = SecurityPermissionFlag.Infrastructure)]
public class ContextAttribute : Attribute, 
    IContextAttribute, IContextProperty
Visual C++
[SerializableAttribute]
[ComVisibleAttribute(true)]
[AttributeUsageAttribute(AttributeTargets::Class)]
[SecurityPermissionAttribute(SecurityAction::LinkDemand, Flags = SecurityPermissionFlag::Infrastructure)]
[SecurityPermissionAttribute(SecurityAction::InheritanceDemand, Flags = SecurityPermissionFlag::Infrastructure)]
public ref class ContextAttribute : public Attribute, 
    IContextAttribute, IContextProperty
JScript
public class ContextAttribute extends Attribute implements IContextAttribute, IContextProperty

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 Extending Metadata Using Attributes.

Notes to Inheritors:

The Name property must not be overridden in any user derived class. The current Equals 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 and GetHashCode methods.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

.NET Framework

Supported in: 3.5, 3.0, 2.0, 1.1, 1.0
Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2009 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks | Privacy Statement
Page view tracker