0
|
1 [BLToolkitGenerated]
|
|
2 public sealed class TestClass : ClearCacheAspect.TestClass
|
|
3 {
|
|
4 private static MethodInfo _methodInfo1;
|
|
5 private static MethodInfo _methodInfo2;
|
|
6 private static Type _type3;
|
|
7 private static Type _type4;
|
|
8
|
|
9 public override int CachedMethod(int p1, int p2)
|
|
10 {
|
|
11 // Method implementation.
|
|
12 }
|
|
13
|
|
14 public override void ClearCache()
|
|
15 {
|
|
16 try
|
|
17 {
|
|
18 // Here should be main method implementation.
|
|
19 // It is empty as this method does nothing.
|
|
20 }
|
|
21 finally
|
|
22 {
|
|
23 if (_methodInfo1 == null)
|
|
24 {
|
|
25 _methodInfo1 =
|
|
26 ClearCacheAspect.GetMethodInfo(this, null, "CachedMethod", null);
|
|
27 }
|
|
28
|
|
29 CacheAspect.ClearCache(_methodInfo1);
|
|
30 }
|
|
31 }
|
|
32
|
|
33 public override void ClearCache2()
|
|
34 {
|
|
35 try
|
|
36 {
|
|
37 }
|
|
38 finally
|
|
39 {
|
|
40 if (_methodInfo2 == null)
|
|
41 {
|
|
42 _methodInfo2 = ClearCacheAspect.GetMethodInfo(
|
|
43 this,
|
|
44 null,
|
|
45 "CachedMethod",
|
|
46 new Type[] { typeof(int), typeof(int) });
|
|
47 }
|
|
48
|
|
49 CacheAspect.ClearCache(_methodInfo2);
|
|
50 }
|
|
51 }
|
|
52
|
|
53 public override void ClearAll()
|
|
54 {
|
|
55 try
|
|
56 {
|
|
57 }
|
|
58 finally
|
|
59 {
|
|
60 if (_type3 == null)
|
|
61 {
|
|
62 _type3 = ClearCacheAspect.GetType(this, typeof(TestClass));
|
|
63 }
|
|
64
|
|
65 CacheAspect.ClearCache(_type3);
|
|
66 }
|
|
67 }
|
|
68
|
|
69 public override void ClearAll2()
|
|
70 {
|
|
71 try
|
|
72 {
|
|
73 }
|
|
74 finally
|
|
75 {
|
|
76 if (_type4 == null)
|
|
77 {
|
|
78 _type4 = ClearCacheAspect.GetType(this, null);
|
|
79 }
|
|
80
|
|
81 CacheAspect.ClearCache(_type4);
|
|
82 }
|
|
83 }
|
|
84 }
|