Context Class

 

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

Defines an environment for the objects that are resident inside it and for which a policy can be enforced.

Namespace:   System.Runtime.Remoting.Contexts
Assembly:  mscorlib (in mscorlib.dll)

System.Object
  System.Runtime.Remoting.Contexts.Context

[ComVisibleAttribute(true)]
public class Context

NameDescription
System_CAPS_pubmethodContext()

This API supports the product infrastructure and is not intended to be used directly from your code. Initializes a new instance of the Context class.

NameDescription
System_CAPS_pubpropertyContextID

This API supports the product infrastructure and is not intended to be used directly from your code. Gets the context ID for the current context.

System_CAPS_pubpropertyContextProperties

This API supports the product infrastructure and is not intended to be used directly from your code. Gets the array of the current context properties.

System_CAPS_pubpropertySystem_CAPS_staticDefaultContext

This API supports the product infrastructure and is not intended to be used directly from your code. Gets the default context for the current application domain.

NameDescription
System_CAPS_pubmethodSystem_CAPS_staticAllocateDataSlot()

This API supports the product infrastructure and is not intended to be used directly from your code. Allocates an unnamed data slot.

System_CAPS_pubmethodSystem_CAPS_staticAllocateNamedDataSlot(String)

This API supports the product infrastructure and is not intended to be used directly from your code. Allocates a named data slot.

System_CAPS_pubmethodDoCallBack(CrossContextDelegate)

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

System_CAPS_pubmethodEquals(Object)

Determines whether the specified object is equal to the current object.(Inherited from Object.)

System_CAPS_protmethodFinalize()

This API supports the product infrastructure and is not intended to be used directly from your code. Cleans up the backing objects for the nondefault contexts.(Overrides Object.Finalize().)

System_CAPS_pubmethodSystem_CAPS_staticFreeNamedDataSlot(String)

This API supports the product infrastructure and is not intended to be used directly from your code. Frees a named data slot on all the contexts.

System_CAPS_pubmethodFreeze()

This API supports the product infrastructure and is not intended to be used directly from your code. Freezes the context, making it impossible to add or remove context properties from the current context.

System_CAPS_pubmethodSystem_CAPS_staticGetData(LocalDataStoreSlot)

This API supports the product infrastructure and is not intended to be used directly from your code. Retrieves the value from the specified slot on the current context.

System_CAPS_pubmethodGetHashCode()

Serves as the default hash function. (Inherited from Object.)

System_CAPS_pubmethodSystem_CAPS_staticGetNamedDataSlot(String)

This API supports the product infrastructure and is not intended to be used directly from your code. Looks up a named data slot.

System_CAPS_pubmethodGetProperty(String)

This API supports the product infrastructure and is not intended to be used directly from your code. Returns a specific context property, specified by name.

System_CAPS_pubmethodGetType()

Gets the Type of the current instance.(Inherited from Object.)

System_CAPS_protmethodMemberwiseClone()

Creates a shallow copy of the current Object.(Inherited from Object.)

System_CAPS_pubmethodSystem_CAPS_staticRegisterDynamicProperty(IDynamicProperty, ContextBoundObject, Context)

This API supports the product infrastructure and is not intended to be used directly from your code. Registers a dynamic property implementing the IDynamicProperty interface with the remoting service.

System_CAPS_pubmethodSystem_CAPS_staticSetData(LocalDataStoreSlot, Object)

This API supports the product infrastructure and is not intended to be used directly from your code. Sets the data in the specified slot on the current context.

System_CAPS_pubmethodSetProperty(IContextProperty)

This API supports the product infrastructure and is not intended to be used directly from your code. Sets a specific context property by name.

System_CAPS_pubmethodToString()

This API supports the product infrastructure and is not intended to be used directly from your code. Returns a String class representation of the current context.(Overrides Object.ToString().)

System_CAPS_pubmethodSystem_CAPS_staticUnregisterDynamicProperty(String, ContextBoundObject, Context)

This API supports the product infrastructure and is not intended to be used directly from your code. Unregisters a dynamic property implementing the IDynamicProperty interface.

A context is an ordered sequence of properties that define an environment for the objects resident inside it. Contexts get created during the activation process for objects that are configured to require certain automatic services, such as synchronization, transactions, just-in-time activation, security, and so on. Multiple objects can live inside a context.

Classes are marked with an instance of the ContextAttribute class, which provides the usage rules. Whenever a new object is instantiated, the .NET Framework finds a compatible or creates a new instance of the Context class for the object. Once an object is placed in a context, it stays in it for life. Classes that can be bound to a context are called context-bound classes. When accessed from another context, such classes are referenced directly by using a proxy. Any call from an object in one context to an object in another context will go through a context proxy and be affected by the policy that the combined context properties enforce.

A new object's context is generally chosen based on meta-data attributes on the class. This mechanism is extensible through custom attributes. These are known as static-context properties, which are compiled into the class meta-data. Dynamic-context properties (also known as configuration properties) can be applied and configured by administrators.

For more information on contexts, see [<topic://cpconboundariesprocessesapplicationdomainscontexts>].

.NET Framework
Available since 1.1

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

Return to top
Show: