static void Main(string[] args) { ActualClass instance1 = ActualClass.getActualClassInstance(); ActualClass instance2 = ActualClass.getActualClassInstance(); int x1 = instance1.replaceValue(41); int x2 = instance2.replaceValue(42); int y1 = instance1.replaceValue(82); Debug.Assert(y1 == 41); int y2 = instance2.replaceValue(84); Debug.Assert(y2 == 42); var read = Console.ReadKey(); }
//This is how we get ActualClass items that are wrapped in the Dynamic Proxy public static ActualClass getActualClassInstance() { ActualClass instance = new ActualClass(); return(pg.CreateClassProxyWithTarget <ActualClass>(instance, interceptor)); }