Mercurial > pub > bltoolkit
comparison Source/Aspects/ClearCacheAspect.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 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 } |