Esempio n. 1
0
 /// <summary>
 /// Gets the value of a field.
 /// </summary>
 /// <param name="name">The name of the field.</param>
 /// <returns>The value of the field</returns>
 public object GetField(string name)
 {
     return(ProfilerInterceptor.GuardInternal(() =>
     {
         var field = ResolveField(name);
         CheckMemberInfo("field", name, field);
         return SecuredReflectionMethods.GetField(field, this.instance);
     }));
 }
Esempio n. 2
0
 private object CallInvoke(MethodBase method, object[] args)
 {
     try
     {
         return(ProfilerInterceptor.GuardExternal(() => SecuredReflectionMethods.Invoke(method, this.instance, args)));
     }
     catch (TargetInvocationException targetInvocationException)
     {
         if (this.RethrowOriginalOnCallMethod && targetInvocationException.InnerException != null)
         {
             throw targetInvocationException.InnerException;
         }
         else
         {
             throw;
         }
     }
 }
Esempio n. 3
0
 private object CallInvoke(MethodBase method, object[] args)
 {
     return(ProfilerInterceptor.GuardExternal(() => SecuredReflectionMethods.Invoke(method, this.instance, args)));
 }