Mercurial > pub > bltoolkit
comparison Source/Aspects/CallMethodInfo.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.Collections; | |
| 3 using System.Reflection; | |
| 4 | |
| 5 namespace BLToolkit.Aspects | |
| 6 { | |
| 7 [System.Diagnostics.DebuggerStepThrough] | |
| 8 public class CallMethodInfo | |
| 9 { | |
| 10 #region Init | |
| 11 | |
| 12 readonly object _sync = new object(); | |
| 13 | |
| 14 #endregion | |
| 15 | |
| 16 #region Public Members | |
| 17 | |
| 18 public CallMethodInfo(MethodInfo methodInfo) | |
| 19 { | |
| 20 _methodInfo = methodInfo; | |
| 21 _parameters = methodInfo.GetParameters(); | |
| 22 } | |
| 23 | |
| 24 private readonly MethodInfo _methodInfo; | |
| 25 public MethodInfo MethodInfo | |
| 26 { | |
| 27 get { return _methodInfo; } | |
| 28 } | |
| 29 | |
| 30 private readonly ParameterInfo[] _parameters; | |
| 31 public ParameterInfo[] Parameters | |
| 32 { | |
| 33 get { return _parameters; } | |
| 34 } | |
| 35 | |
| 36 volatile Hashtable _items; | |
| 37 public IDictionary Items | |
| 38 { | |
| 39 get | |
| 40 { | |
| 41 if (_items == null) lock (_sync) if (_items == null) | |
| 42 _items = Hashtable.Synchronized(new Hashtable()); | |
| 43 | |
| 44 return _items; | |
| 45 } | |
| 46 } | |
| 47 | |
| 48 private CacheAspect _cacheAspect; | |
| 49 public CacheAspect CacheAspect | |
| 50 { | |
| 51 get { return _cacheAspect; } | |
| 52 internal set { _cacheAspect = value; } | |
| 53 } | |
| 54 | |
| 55 [Obsolete("Use CacheAspect.Cache instead")] | |
| 56 public IDictionary MethodCallCache | |
| 57 { | |
| 58 get { return _cacheAspect != null? _cacheAspect.Cache: new Hashtable(); } | |
| 59 } | |
| 60 | |
| 61 #endregion | |
| 62 | |
| 63 #region Proptected Members | |
| 64 | |
| 65 private bool[] _cacheableParameters; | |
| 66 internal bool[] CacheableParameters | |
| 67 { | |
| 68 get { return _cacheableParameters; } | |
| 69 set { _cacheableParameters = value; } | |
| 70 } | |
| 71 | |
| 72 #endregion | |
| 73 } | |
| 74 } | 
