Inspecting an Object’s Context
Although very few of the applications you will write will need to programmatically interact with
context, here is an illustrative example. Create a new Console Application named ContextManipulator.
This application defines one context-agile class (SportsCar) and a single context-bound type
(SportsCarTS):
using System.Runtime.Remoting.Contexts; // For Context type.
using System.Threading; // For Thread type.
// SportsCar has no special contextual
// needs and will be loaded into the
// default context of the app domain.
C H A P T E R 1 7
■
P R O C E S S E S, A P P D O M A I N S, A N D O B J E C T C O N T E X T S
579
8849CH17.qxd 10/9/07 4:29 PM Page 579
class SportsCar
{
public SportsCar()
{
Do'stlaringiz bilan baham: |