0
|
1 using System;
|
|
2
|
|
3 using BLToolkit.TypeBuilder.Builders;
|
|
4
|
|
5 namespace BLToolkit.Aspects
|
|
6 {
|
|
7 /// <summary>
|
|
8 /// http://www.bltoolkit.net/Doc/Aspects/index.htm
|
|
9 /// </summary>
|
|
10 [AttributeUsage(AttributeTargets.Property | AttributeTargets.Method, AllowMultiple=true)]
|
|
11 public class ClearCacheAttribute : AbstractTypeBuilderAttribute
|
|
12 {
|
|
13 #region Constructors
|
|
14
|
|
15 public ClearCacheAttribute()
|
|
16 {
|
|
17 }
|
|
18
|
|
19 public ClearCacheAttribute(string methodName)
|
|
20 {
|
|
21 _methodName = methodName;
|
|
22 }
|
|
23
|
|
24 public ClearCacheAttribute(string methodName, params Type[] parameterTypes)
|
|
25 {
|
|
26 _methodName = methodName;
|
|
27 _parameterTypes = parameterTypes;
|
|
28 }
|
|
29
|
|
30 public ClearCacheAttribute(Type declaringType, string methodName, params Type[] parameterTypes)
|
|
31 {
|
|
32 _declaringType = declaringType;
|
|
33 _methodName = methodName;
|
|
34 _parameterTypes = parameterTypes;
|
|
35 }
|
|
36
|
|
37 public ClearCacheAttribute(Type declaringType)
|
|
38 {
|
|
39 _declaringType = declaringType;
|
|
40 }
|
|
41
|
|
42 readonly Type _declaringType;
|
|
43 readonly string _methodName;
|
|
44 readonly Type[] _parameterTypes;
|
|
45
|
|
46 #endregion
|
|
47
|
|
48 public override IAbstractTypeBuilder TypeBuilder
|
|
49 {
|
|
50 get { return new Builders.ClearCacheAspectBuilder(_declaringType, _methodName, _parameterTypes); }
|
|
51 }
|
|
52 }
|
|
53 }
|