Esempio n. 1
0
 public override void Before(UnifiedElement model, AspectElement.Pointcut target, UnifiedBlock advice)
 {
     var exceptions = model.Descendants<UnifiedCatch>();
     foreach (var e in exceptions) {
         var regex = new Regex("^" + target.GetTargetName().ElementAt(1) + "$");
         var type = e.Types[0].BasicTypeName as UnifiedIdentifier;
         if(type == null)
             continue;
         var m = regex.Match(type.Name);
         if (m.Success) {
             //アドバイスを対象関数に合成する
             e.Body.Insert(0, advice.DeepCopy());
         }
     }
 }
Esempio n. 2
0
 public override void Before(UnifiedElement model, AspectElement.Pointcut target, UnifiedBlock advice)
 {
     InsertAtBeforeCallByName(model, target.GetTargetName().ElementAt(1), advice);
 }
Esempio n. 3
0
 public override void After(UnifiedElement model, AspectElement.Pointcut target, UnifiedBlock advice)
 {
     InsertAtAfterGetByName(model, target.GetTargetName().ElementAt(1), advice);
 }