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)); }
public static ref T GuardInternal <T>(RefReturn <T> @delegate, object target, object[] args) { try { ReentrancyCounter++; return(ref @delegate(target, args)); } finally { ReentrancyCounter--; } }
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; } }