0
|
1 using System;
|
|
2
|
|
3 using BLToolkit.TypeBuilder.Builders;
|
|
4
|
|
5 namespace BLToolkit.Aspects
|
|
6 {
|
|
7 [AttributeUsage(
|
|
8 AttributeTargets.Class |
|
|
9 AttributeTargets.Interface |
|
|
10 AttributeTargets.Property |
|
|
11 AttributeTargets.Method,
|
|
12 AllowMultiple=true)]
|
|
13 public class NoInterceptionAttribute : InterceptorAttribute
|
|
14 {
|
|
15 public NoInterceptionAttribute()
|
|
16 : base(null, 0)
|
|
17 {
|
|
18 }
|
|
19
|
|
20 public NoInterceptionAttribute(Type interceptorType, InterceptType interceptType)
|
|
21 : base(interceptorType, interceptType)
|
|
22 {
|
|
23 }
|
|
24
|
|
25 public override IAbstractTypeBuilder TypeBuilder
|
|
26 {
|
|
27 get { return new NoInterceptionAspectBuilder(InterceptorType, InterceptType); }
|
|
28 }
|
|
29
|
|
30 private class NoInterceptionAspectBuilder : Builders.InterceptorAspectBuilder
|
|
31 {
|
|
32 public NoInterceptionAspectBuilder(Type interceptorType, InterceptType interceptType)
|
|
33 : base(interceptorType, interceptType, null, TypeBuilderConsts.Priority.Normal, false)
|
|
34 {
|
|
35 }
|
|
36
|
|
37 public override void Build(BuildContext context)
|
|
38 {
|
|
39 if (context.Step == BuildStep.Begin || context.Step == BuildStep.End)
|
|
40 base.Build(context);
|
|
41 }
|
|
42 }
|
|
43 }
|
|
44 }
|