System.ContextStaticAttribute Class

Indicates that the value of a static field is unique for a particular context.

See Also: ContextStaticAttribute Members

Syntax

[System.AttributeUsage(System.AttributeTargets.Field, Inherited=false)]
[System.Runtime.InteropServices.ComVisible(true)]
public class ContextStaticAttribute : Attribute

Remarks

A static field marked with ContextStaticAttribute is not shared between contexts. If the indicated static field is accessed on a different context, it will contain a different value. Use this attribute as it is, and do not derive from it.

The following example shows the syntax of this attribute:

[ContextStatic]

static int f=7;

For more information about using attributes, see [<topic://cpconExtendingMetadataUsingAttributes>].

Requirements

Namespace: System
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0, 4.0.0.0