0
|
1 using System;
|
|
2 using System.Reflection;
|
|
3
|
|
4 namespace BLToolkit.Aspects
|
|
5 {
|
|
6 public class ClearCacheAspect
|
|
7 {
|
|
8 public static MethodInfo GetMethodInfo(
|
|
9 object caller, Type declaringType, string methodName, Type[] parameterTypes)
|
|
10 {
|
|
11 if (declaringType == null)
|
|
12 declaringType = caller.GetType();
|
|
13
|
|
14 return CacheAspect.GetMethodInfo(declaringType, methodName, parameterTypes);
|
|
15 }
|
|
16
|
|
17 public static Type GetType(object caller, Type declaringType)
|
|
18 {
|
|
19 if (declaringType == null)
|
|
20 declaringType = caller.GetType();
|
|
21
|
|
22 if (declaringType.IsAbstract)
|
|
23 declaringType = TypeBuilder.TypeFactory.GetType(declaringType);
|
|
24
|
|
25 return declaringType;
|
|
26 }
|
|
27 }
|
|
28 }
|