PageRenderTime 26ms CodeModel.GetById 17ms app.highlight 6ms RepoModel.GetById 1ms app.codeStats 0ms

/BlogEngine/DotNetSlave.BusinessLogic/Providers/CacheProvider/CacheBase.cs

#
C# | 87 lines | 25 code | 2 blank | 60 comment | 0 complexity | e353c3ba6afb3be3ade13abab93606d8 MD5 | raw file
 1using System;
 2using System.Collections;
 3using System.Web.Caching;
 4
 5namespace BlogEngine.Core.Providers.CacheProvider
 6{
 7    /// <summary>
 8    /// Cache Base
 9    /// </summary>
10    public abstract class CacheBase : IEnumerable
11    {
12        /// <summary>
13        /// Count
14        /// </summary>
15        public abstract int Count { get; }
16        /// <summary>
17        /// Physical Memory Limit
18        /// </summary>
19        public abstract long EffectivePercentagePhysicalMemoryLimit { get; }
20        ///<summary>
21        ///</summary>
22        public abstract long EffectivePrivateBytesLimit { get; }
23        ///<summary>
24        ///</summary>
25        ///<param name="key"></param>
26        public abstract object this[string key] { get; set; }
27        ///<summary>
28        ///</summary>
29        ///<param name="key"></param>
30        ///<param name="value"></param>
31        ///<param name="dependencies"></param>
32        ///<param name="absoluteExpiration"></param>
33        ///<param name="slidingExpiration"></param>
34        ///<param name="priority"></param>
35        ///<param name="onRemoveCallback"></param>
36        ///<returns></returns>
37        public abstract object Add(string key, object value, CacheDependency dependencies, DateTime absoluteExpiration, TimeSpan slidingExpiration, CacheItemPriority priority, CacheItemRemovedCallback onRemoveCallback);
38        ///<summary>
39        ///</summary>
40        ///<param name="key"></param>
41        ///<returns></returns>
42        public abstract object Get(string key);
43        ///<summary>
44        ///</summary>
45        ///<returns></returns>
46        public abstract IDictionaryEnumerator GetEnumerator();
47        ///<summary>
48        ///</summary>
49        ///<param name="key"></param>
50        ///<param name="value"></param>
51        public abstract void Insert(string key, object value);
52        ///<summary>
53        ///</summary>
54        ///<param name="key"></param>
55        ///<param name="value"></param>
56        ///<param name="dependencies"></param>
57        public abstract void Insert(string key, object value, CacheDependency dependencies);
58        ///<summary>
59        ///</summary>
60        ///<param name="key"></param>
61        ///<param name="value"></param>
62        ///<param name="dependencies"></param>
63        ///<param name="absoluteExpiration"></param>
64        ///<param name="slidingExpiration"></param>
65        public abstract void Insert(string key, object value, CacheDependency dependencies, DateTime absoluteExpiration, TimeSpan slidingExpiration);
66        ///<summary>
67        ///</summary>
68        ///<param name="key"></param>
69        ///<param name="value"></param>
70        ///<param name="dependencies"></param>
71        ///<param name="absoluteExpiration"></param>
72        ///<param name="slidingExpiration"></param>
73        ///<param name="priority"></param>
74        ///<param name="onRemoveCallback"></param>
75        public abstract void Insert(string key, object value, CacheDependency dependencies, DateTime absoluteExpiration, TimeSpan slidingExpiration, CacheItemPriority priority, CacheItemRemovedCallback onRemoveCallback);
76        ///<summary>
77        ///</summary>
78        ///<param name="key"></param>
79        ///<returns></returns>
80        public abstract object Remove(string key);
81
82        IEnumerator IEnumerable.GetEnumerator()
83        {
84            return GetEnumerator();
85        }
86    }
87}