comparison Source/Aspects/NoInterceptionAttribute.cs @ 0:f990fcb411a9

Копия текущей версии из github
author cin
date Thu, 27 Mar 2014 21:46:09 +0400
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:f990fcb411a9
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 }