예제 #1
0
        static void Main(string[] args)
        {
            SerializationService.Initialize();
            ParrotWrapper.Initialize();
            SerializationService.AppendSurrogate(typeof(g1), new g1_surrogate());
            SerializationService.AppendSurrogate(typeof(g2), new g2_surrogate());
            ParrotWrapper.ParrotPatchExpressiontarget <Action <g1> >((__instance) => __instance.Do());
            new g1().Do();
            SyncTickData.AvoidLoop = true;
            byte[] b;
            var    _dat = SerializationService.DeserializeFrom(b = SerializationService.Flush());

            foreach (var dat in _dat)
            {
                if (dat.methodContext > -1)
                {
                    ParrotWrapper.IndexedCall(dat.methodContext, dat.dataObjects.ToArray());
                }
            }

            /*
             * MemberTracker<bool>.TrackPublicField<Func<bool>>(() => static_flag, u => static_flag = u);
             * static_flag = true;
             * //MemberTracker<bool>.ApplyChange(true, 0);
             *
             * ParrotWrapper.ParrotPatchExpressiontarget<Action<bool, int>>((newVal, index)=> MemberTracker<bool>.ApplyChange(newVal, index));
             * MemberTracker<bool>.ApplyChange(false, 0);
             *
             * SyncTickData.AvoidLoop = true;
             * byte[] b;
             * var _dat = SerializationService.DeserializeFrom(b = SerializationService.Flush());
             *
             * foreach (var dat in _dat)
             * {
             *  if (dat.methodContext > -1)
             *  {
             *      ParrotWrapper.IndexedCall(dat.methodContext, dat.dataObjects.ToArray());
             *  }
             * }*/


            //CooperateRim.ParrotWrapper.ParrotPatchExpressiontarget<Action<BillStack, Bill>>((__instance, bill) => __instance.AddBill(bill));

            /*
             * CooperateRim.ParrotWrapper.ParrotPatchExpressiontarget<Action<tester, string>>((__instance, name_something) => __instance.DoSomething(name_something));
             * tester t = new tester();
             * t.DoSomething("1");
             *
             * SyncTickData.AvoidLoop = true;
             * byte[] b;
             * var _dat = SerializationService.DeserializeFrom(b = SerializationService.Flush());
             *
             * foreach (var dat in _dat)
             * {
             *  ParrotWrapper.IndexedCall(dat.methodContext, dat.dataObjects.ToArray());
             * }
             *
             * t.DoSomething("2");*/
        }