0
|
1 using System;
|
|
2
|
|
3 namespace BLToolkit.Aspects
|
|
4 {
|
|
5 /// <summary>
|
|
6 /// http://www.bltoolkit.net/Doc/Aspects/index.htm
|
|
7 /// </summary>
|
|
8 [AttributeUsage(
|
|
9 AttributeTargets.Class |
|
|
10 AttributeTargets.Interface |
|
|
11 AttributeTargets.Property |
|
|
12 AttributeTargets.Method,
|
|
13 AllowMultiple=true)]
|
|
14 public class InstanceCacheAttribute : CacheAttribute
|
|
15 {
|
|
16 #region Constructors
|
|
17
|
|
18 public InstanceCacheAttribute()
|
|
19 : this(typeof(CacheAspect), null)
|
|
20 {
|
|
21 }
|
|
22
|
|
23 public InstanceCacheAttribute(Type cacheAspectType, string configString)
|
|
24 : base(cacheAspectType, configString)
|
|
25 {
|
|
26 }
|
|
27
|
|
28 public InstanceCacheAttribute(Type interceptorType)
|
|
29 : this(interceptorType, null)
|
|
30 {
|
|
31 }
|
|
32
|
|
33 public InstanceCacheAttribute(Type interceptorType, int maxCacheTime)
|
|
34 : this(interceptorType, null)
|
|
35 {
|
|
36 MaxCacheTime = maxCacheTime;
|
|
37 }
|
|
38
|
|
39 public InstanceCacheAttribute(Type interceptorType, bool isWeak)
|
|
40 : this(interceptorType, null)
|
|
41 {
|
|
42 IsWeak = isWeak;
|
|
43 }
|
|
44
|
|
45 public InstanceCacheAttribute(Type interceptorType, int maxCacheTime, bool isWeak)
|
|
46 : this(interceptorType, null)
|
|
47 {
|
|
48 MaxCacheTime = maxCacheTime;
|
|
49 IsWeak = isWeak;
|
|
50 }
|
|
51
|
|
52 public InstanceCacheAttribute(string configString)
|
|
53 : this(typeof(CacheAspect), configString)
|
|
54 {
|
|
55 }
|
|
56
|
|
57 public InstanceCacheAttribute(int maxCacheTime)
|
|
58 : this(typeof(CacheAspect), maxCacheTime)
|
|
59 {
|
|
60 }
|
|
61
|
|
62 public InstanceCacheAttribute(bool isWeak)
|
|
63 : this(typeof(CacheAspect), isWeak)
|
|
64 {
|
|
65 }
|
|
66
|
|
67 public InstanceCacheAttribute(int maxCacheTime, bool isWeak)
|
|
68 : this(typeof(CacheAspect), maxCacheTime, isWeak)
|
|
69 {
|
|
70 }
|
|
71
|
|
72 #endregion
|
|
73
|
|
74 public override bool LocalInterceptor
|
|
75 {
|
|
76 get { return true; }
|
|
77 }
|
|
78 }
|
|
79 }
|