예제 #1
0
 public FieldControler(Expression <Func <ParentType, FieldType> > Field)
 {
     this.Field    = typeof(ParentType).GetField(((MemberExpression)Field.Body).Member.Name);
     this.RefValue = _GetValueRef(this.Field);
     this.GetValue = _GetValue(this.Field);
     this.SetValue = TypeController.SetValue(typeof(ParentType).GetField(((MemberExpression)Field.Body).Member.Name));
 }
예제 #2
0
 public static ref T GuardInternal <T>(RefReturn <T> @delegate, object target, object[] args)
 {
     try
     {
         ReentrancyCounter++;
         return(ref @delegate(target, args));
     }
     finally
     {
         ReentrancyCounter--;
     }
 }
예제 #3
0
        public static ref T GuardExternal <T>(RefReturn <T> @delegate, object target, object[] args)
        {
            var oldCounter = ProfilerInterceptor.ReentrancyCounter;

            try
            {
                ProfilerInterceptor.ReentrancyCounter = 0;
                return(ref @delegate(target, args));
            }
            finally
            {
                ProfilerInterceptor.ReentrancyCounter = oldCounter;
            }
        }