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
 // TODO Pointcutの名前が競合しないようにする
 public abstract void Before(UnifiedElement model, AspectElement.Pointcut target, UnifiedBlock advice);
Esempio n. 3
0
 public override void Before(UnifiedElement model, AspectElement.Pointcut target, UnifiedBlock advice)
 {
     InsertAtBeforeCallByName(model, target.GetTargetName().ElementAt(1), advice);
 }
Esempio n. 4
0
 public override void After(UnifiedElement model, AspectElement.Pointcut target, UnifiedBlock advice)
 {
     InsertAtAfterGetByName(model, target.GetTargetName().ElementAt(1), advice);
 }
		// 指定されたポイントカット(名)に対応するafterの織り込み処理を与えられたmodelに適用します
		public static void WeavingAfter(string name, UnifiedElement model, AspectElement.Pointcut target, UnifiedBlock advice) {
			var aspect = GetProcessorFromName(name);
			aspect.After(model, target, advice);
		}
Esempio n. 6
0
 public override void After(UnifiedElement model, AspectElement.Pointcut target, UnifiedBlock advice)
 {
     throw new NotImplementedException();
 }