Contributes an interception sink at the context boundary on the client end of a remoting call.
IContributeClientContextSink
[Visual Basic] Public Interface IContributeClientContextSink [C#] public interface IContributeClientContextSink [C++] public __gc __interface IContributeClientContextSink
[JScript] In JScript, you can use the interfaces in the NGWS frameworks, but you cannot define your own.
Class | Description |
---|---|
Synchronization | [To be supplied.] |
ThreadAffinity | Key Points:
Refinement of Synchronized Context Mark type with Thread Affinity Context Attribute Only a single thread allowed to execute within the Synchronization Domain, hence only that thread can access instance fields and methods Useful: User Interface objects Objects that hold onto OS resource that should only be accessed on the thread that created them The Thread Affinity Context Property provides a similar capability as the Synchronization Context property with the further constraint that only a single thread is allow to execute within the context or synchronization domain at any time. This is useful for objects that could hold onto OS resources that should only be accessed from a particular thread and only that thread. Thread Affinity is useful when users want to always access the object on the same thread. Certain UI resources should only be accessed on the same thread, on which they were created. An instance of this property in a context enforces a thread affinity domain for the context (and all contexts that share the same instance). This means that for all contexts sharing an instance of this property, all methods on objects resident in those contexts will execute on the same thread for the lifetime of the objects. This is done by contributing message sinks that intercept and serialize in-coming calls. If the property is marked for reentrancy, then call-outs are intercepted too. The call-out interception allows other waiting calls to enter the thread affinity domain. [ThreadAffinity()] public class Foo: ContextBoundObject { . . .// implementation for Foo } // Make an instance of Foo void SomeOtherMethod(void) { . . . Foo foo = new Foo(); } |
The IContributeClientContextSink interface is implemented by context properties in a Context.
The client context chain is composed from those properties in the client context that implement IContributeClientContextSink interface, which contributes to a sink via the GetClientContextSink method call. This chain is cached for future use.
Namespace: System.Runtime.Remoting
Assembly: mscorlib.dll
IContributeClientContextSink Members | System.Runtime.Remoting Namespace