Ejemplo n.º 1
0
 public object Intercept(LinFu.DynamicProxy.InvocationInfo invocation)
 {
     var args = invocation.Arguments;
     if (invocation.TargetMethod.Name == "OnSpecificationEnd")
         onSpecificationEnd(args[0], args[1]);
     else if (invocation.TargetMethod.Name == "OnSpecificationStart")
         onSpecificationStart(args[0]);
     return null;
 }
Ejemplo n.º 2
0
 public override object Intercept(LinFu.AOP.Interfaces.IInvocationInfo info)
 {
     object ret = info.TargetMethod.Invoke (info.Target, info.Arguments);
     if (((PopupType)typeof(Popups).GetField ("currentPopupType", BindingFlags.Instance | BindingFlags.NonPublic).GetValue (info.Target)) == PopupType.SAVE_DECK
         && typeof(Popups).GetField ("popupType", BindingFlags.Instance | BindingFlags.NonPublic).GetValue (info.Target).Equals("login")) {
         float num2 = Screen.height * 0.03f;
         Rect rect = new Rect((Screen.width * 0.5f) - (Screen.height * 0.35f), Screen.height * 0.3f, Screen.height * 0.7f, Screen.height * 0.4f);
         Rect popupInner = new Rect(rect.x + num2, rect.y + num2, rect.width - (2f * num2), rect.height - (2f * num2));
         Rect rect9 = new Rect(popupInner.x + (popupInner.width * 0.2f), popupInner.y + (popupInner.height * 0.5f) + popupInner.height * 0.13f, popupInner.width * 0.6f, popupInner.height * 0.14f);
         this.encryptedPassword = GUI.PasswordField (rect9, this.encryptedPassword, '*');
     }
     return ret;
 }
Ejemplo n.º 3
0
 public bool AppliesTo(object target, LinFu.DynamicProxy.InvocationInfo info)
 {
     if (target as Account == null)
         return false;
     if (info.TargetMethod.Name == "Deposit")
         return true;
     return false;
 }
Ejemplo n.º 4
0
 public void ShowError(System.IO.TextWriter output, object target, LinFu.DynamicProxy.InvocationInfo info, object returnValue)
 {
     throw new NotImplementedException();
 }
Ejemplo n.º 5
0
 public bool Check(object target, LinFu.DynamicProxy.InvocationInfo info, object returnValue)
 {
     throw new NotImplementedException();
 }
Ejemplo n.º 6
0
 public void BeforeMethodCall(object target, LinFu.DynamicProxy.InvocationInfo info)
 {
 }
Ejemplo n.º 7
0
 public bool AppliesTo(object target, LinFu.DynamicProxy.InvocationInfo info)
 {
     throw new NotImplementedException();
 }
Ejemplo n.º 8
0
 public bool Check(object target, LinFu.DynamicProxy.InvocationInfo info)
 {
     LinFuCalculator cc = (LinFuCalculator)target;
     return true;
 }
Ejemplo n.º 9
0
 public bool AppliesTo(object target, LinFu.DynamicProxy.InvocationInfo info)
 {
     if (info.TargetMethod.Name == "Mult")
         return true;
     return false;
 }
Ejemplo n.º 10
0
 public bool Check(object target, LinFu.DynamicProxy.InvocationInfo info, object returnValue)
 {
     Account account = target as Account;
     return account.Balance == oldBalance + (int)info.Arguments[0];
 }
Ejemplo n.º 11
0
 public void BeforeMethodCall(object target, LinFu.DynamicProxy.InvocationInfo info)
 {
     oldBalance = (target as Account).Balance;
 }