• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# CacheItemPriority类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中CacheItemPriority的典型用法代码示例。如果您正苦于以下问题:C# CacheItemPriority类的具体用法?C# CacheItemPriority怎么用?C# CacheItemPriority使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



CacheItemPriority类属于命名空间,在下文中一共展示了CacheItemPriority类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: Insert

		public static void Insert(string key, object value, CacheDependency dependency, TimeSpan timeframe, CacheItemPriority priority)
		{
			if (value != null)
			{
				_cache.Insert(key, value, dependency, DateTime.Now.Add(timeframe), Cache.NoSlidingExpiration, priority, null);
			}
		}
开发者ID:Wdovin,项目名称:vc-community,代码行数:7,代码来源:WFFileSystemWorkflowActivityProvider.cs


示例2: CacheItem

		/// <summary>Costructor</summary>
		/// <param name="value">Actual object to be stored in cache</param>
		public CacheItem(object value)
		{
			_v = value;
			_abs = Cache.NoAbsoluteExpiration;
		    _sld = Cache.NoSlidingExpiration;
			_p = CacheItemPriority.Default;
		}
开发者ID:christrotter,项目名称:NCache,代码行数:9,代码来源:CacheItem.cs


示例3: SetPriority

 /// <summary>
 /// Sets the priority for keeping the cache entry in the cache during a memory pressure tokened cleanup.
 /// </summary>
 /// <param name="options"></param>
 /// <param name="priority"></param>
 public static MemoryCacheEntryOptions SetPriority(
     this MemoryCacheEntryOptions options,
     CacheItemPriority priority)
 {
     options.Priority = priority;
     return options;
 }
开发者ID:benaadams,项目名称:Caching,代码行数:12,代码来源:MemoryCacheEntryExtensions.cs


示例4: AddCommand

        internal AddCommand(string key, byte[] value, DateTime absoluteExpiration, TimeSpan slidingExpiration, CacheItemPriority priority, short removeCallback, short updateCallback, Hashtable queryInfo, BitSet flagMap, string cacheId,EventDataFilter updateDataFilter,EventDataFilter removeDataFilter)
        {
            base.name = "AddCommand";
            base.key = key;

            _addCommand = new Alachisoft.NCache.Common.Protobuf.AddCommand();

            if (absoluteExpiration != Cache.NoAbsoluteExpiration)
                _addCommand.absExpiration = absoluteExpiration.Ticks;

            if (slidingExpiration != Cache.NoSlidingExpiration)
                _addCommand.sldExpiration = slidingExpiration.Ticks;

            Alachisoft.NCache.Caching.UserBinaryObject ubObject = Alachisoft.NCache.Caching.UserBinaryObject.CreateUserBinaryObject(value);

            _addCommand.key = key;
            _addCommand.data.AddRange(ubObject.DataList);
            _addCommand.requestId = base.RequestId;
            _addCommand.updateCallbackId = updateCallback;
            _addCommand.removeCallbackId = removeCallback;
            _addCommand.priority = (int)priority;
            _addCommand.flag = flagMap.Data;
            _addCommand.updateDataFilter = (short)updateDataFilter;
            _addCommand.removeDataFilter = (short)removeDataFilter;

            // Changes made to send Queries, Tags and NamgedTags in a single object
            ObjectQueryInfo objectQueryInfo = new ObjectQueryInfo();

            if (queryInfo["query-info"] != null)
                objectQueryInfo.queryInfo = ProtobufHelper.GetQueryInfoObj(queryInfo["query-info"] as Hashtable);

                _addCommand.objectQueryInfo = objectQueryInfo;
        }
开发者ID:javithalion,项目名称:NCache,代码行数:33,代码来源:AddCommand.cs


示例5: CacheItemArgs

 public CacheItemArgs(string key)
 {
     _CacheKey = key;
     _CacheTimeOut = 20;
     _CachePriority = CacheItemPriority.Default;
     //_ParamList = new ArrayList();
 }
开发者ID:jackiechou,项目名称:thegioicuaban.com,代码行数:7,代码来源:CacheItemArgs.cs


示例6: InsertCommand

        public InsertCommand(string key, byte[] value, DateTime absoluteExpiration, TimeSpan slidingExpiration, CacheItemPriority priority, short removeCallback, short updateCallback, Hashtable queryInfo, BitSet flagMap, object lockId, LockAccessType accessType, string cacheId, EventDataFilter updateCallbackFilter, EventDataFilter removeCallabackFilter)
        {
            base.name = "InsertCommand";
            base.key = key;

            _insertCommand = new Alachisoft.NCache.Common.Protobuf.InsertCommand();
            _insertCommand.key = key;

            Alachisoft.NCache.Caching.UserBinaryObject ubObject = UserBinaryObject.CreateUserBinaryObject(value);
            _insertCommand.data.AddRange(ubObject.DataList);

            _insertCommand.requestId = base.RequestId;
            _insertCommand.removeCallbackId = removeCallback;
            _insertCommand.updateCallbackId = updateCallback;
            _insertCommand.updateDataFilter = (short)updateCallbackFilter;
            _insertCommand.removeDataFilter = (short)removeCallabackFilter;
            _insertCommand.priority = (int)priority;
            _insertCommand.flag = flagMap.Data;
            if(lockId != null) _insertCommand.lockId = lockId.ToString();
            _insertCommand.lockAccessType = (int)accessType;

            if (absoluteExpiration != Web.Caching.Cache.NoAbsoluteExpiration)
                _insertCommand.absExpiration = absoluteExpiration.Ticks;

            if (slidingExpiration != Web.Caching.Cache.NoSlidingExpiration)
            _insertCommand.sldExpiration = slidingExpiration.Ticks;

            ObjectQueryInfo objectQueryInfo = new ObjectQueryInfo();

            if (queryInfo["query-info"] != null)
                objectQueryInfo.queryInfo = ProtobufHelper.GetQueryInfoObj(queryInfo["query-info"] as Hashtable);

                _insertCommand.objectQueryInfo = objectQueryInfo;
        }
开发者ID:javithalion,项目名称:NCache,代码行数:34,代码来源:InsertCommand.cs


示例7: Insert

 public static void Insert(string key, object obj, CacheDependency dep, int seconds, CacheItemPriority priority)
 {
     if (obj != null)
     {
         _cache.Insert(key, obj, dep, DateTime.Now.AddSeconds((double) (Factor * seconds)), TimeSpan.Zero, priority, null);
     }
 }
开发者ID:huaminglee,项目名称:myyyyshop,代码行数:7,代码来源:DataCache.cs


示例8: CacheItem

        /// <summary>
        /// Constructs a fully formed CacheItem. This constructor is to be used when restoring an existing
        /// CacheItem from the backing store. As such, it does not generate its own Guid for this instance,
        /// but allows the guid to be passed in, as read from the backing store.
        /// </summary>
        /// <param name="lastAccessedTime">Time this CacheItem last accessed by user.</param>
        /// <param name="key">Key provided  by the user for this cache item. May not be null.</param>
        /// <param name="value">Value to be stored. May be null.</param>
		/// <param name="scavengingPriority">Scavenging priority of CacheItem. See <see cref="CacheItemPriority" /> for values.</param>
        /// <param name="refreshAction">Object supplied by caller that will be invoked upon expiration of the CacheItem. May be null.</param>
		/// <param name="expirations">Param array of ICacheItemExpiration objects. May provide 0 or more of these.</param>
        public CacheItem(DateTime lastAccessedTime, string key, object value, CacheItemPriority scavengingPriority, ICacheItemRefreshAction refreshAction, params ICacheItemExpiration[] expirations)
        {
            Initialize(key, value, refreshAction, scavengingPriority, expirations);

            TouchedByUserAction(false, lastAccessedTime);
            InitializeExpirations();
        }
开发者ID:wuyingyou,项目名称:uniframework,代码行数:18,代码来源:CacheItem.cs


示例9: AddCache

 /// <summary>
 /// 建立定时不访问便移除的缓存
 /// </summary>
 public static object AddCache(string key, object value, TimeSpan slidingExpiration, CacheItemPriority priority)
 {
     if (HttpRuntime.Cache[key] == null && value != null)
         return HttpRuntime.Cache.Add(key, value, null, Cache.NoAbsoluteExpiration, slidingExpiration, priority, null);
     else
         return null;
 }
开发者ID:pyfxl,项目名称:fxlweb,代码行数:10,代码来源:CacheHelper.cs


示例10: Insert

 public void Insert(string key, object value, CacheDependency dependencies,
     DateTime absoluteExpiration, TimeSpan slidingExpiration,
     CacheItemPriority priority, CacheItemRemovedCallback onRemoveCallback)
 {
     _cache.Insert(key, value, dependencies, absoluteExpiration, slidingExpiration,
         priority, onRemoveCallback);
 }
开发者ID:jammycakes,项目名称:dolstagis.ideas,代码行数:7,代码来源:HttpRuntimeCache.cs


示例11: CacheItem

        public CacheItem(string key, object value, CacheItemPriority scavengingPriority,params ICacheItemExpiration[] expirations)
        {
            Initialize(key, value, scavengingPriority, expirations);

            TouchedByUserAction(false);
            InitializeExpirations();
        }
开发者ID:Tony-Liang,项目名称:Common,代码行数:7,代码来源:CacheItem.cs


示例12: CacheEntry

		internal CacheEntry (Cache objManager, string strKey, object objItem,CacheDependency objDependency,
				CacheItemRemovedCallback eventRemove, DateTime dtExpires, TimeSpan tsSpan,
				long longMinHits, bool boolPublic, CacheItemPriority enumPriority )
		{
			if (boolPublic)
				_enumFlags |= Flags.Public;

			_strKey = strKey;
			_objItem = objItem;
			_objCache = objManager;
			_onRemoved += eventRemove;
			_enumPriority = enumPriority;
			_ticksExpires = dtExpires.ToUniversalTime ().Ticks;
			_ticksSlidingExpiration = tsSpan.Ticks;

			// If we have a sliding expiration it overrides the absolute expiration (MS behavior)
			// This is because sliding expiration causes the absolute expiration to be 
			// moved after each period, and the absolute expiration is the value used 
			// for all expiration calculations.
			if (tsSpan.Ticks != Cache.NoSlidingExpiration.Ticks)
				_ticksExpires = DateTime.UtcNow.AddTicks (_ticksSlidingExpiration).Ticks;
			
			_objDependency = objDependency;
			if (_objDependency != null)
				// Add the entry to the cache dependency handler (we support multiple entries per handler)
				_objDependency.Changed += new CacheDependencyChangedHandler (OnChanged); 

			_longMinHits = longMinHits;
		}
开发者ID:jjenki11,项目名称:blaze-chem-rendering,代码行数:29,代码来源:CacheEntry.cs


示例13: Insert

        public override void Insert(string cacheKey, object itemToCache, DNNCacheDependency dependency, DateTime absoluteExpiration, TimeSpan slidingExpiration, CacheItemPriority priority,
                                   CacheItemRemovedCallback onRemoveCallback)
        {
            //onRemoveCallback += ItemRemovedCallback;

            //Call base class method to add obect to cache
            base.Insert(cacheKey, itemToCache, dependency, absoluteExpiration, slidingExpiration, priority, onRemoveCallback);
        }
开发者ID:robsiera,项目名称:OpenUrlRewriter,代码行数:8,代码来源:OpenUrlRewriterFBCachingProvider.cs


示例14: RedisCacheEntry

 public RedisCacheEntry(String key,
     Object value,
     DateTimeOffset absoluteExpiration,
     TimeSpan slidingExpiration,
     CacheItemPriority priority)
     : this(key, value, absoluteExpiration, slidingExpiration, priority.ToString())
 {
 }
开发者ID:cityindex,项目名称:Redis-Object-Cache,代码行数:8,代码来源:RedisCacheEntry.cs


示例15: CachedLifetime

        public static IExpressionRegistration CachedLifetime(this IExpressionRegistration registration, TimeSpan slidingExpiration, CacheDependency dependency = null, CacheItemPriority itemPriority = CacheItemPriority.Default, CacheItemRemovedCallback itemRemovedCallback = null)
        {
            if (registration == null)
                throw new ArgumentNullException("registration");

            registration.SetLifetime(new CachedLifetime(slidingExpiration, dependency, itemPriority, itemRemovedCallback));
            return registration;
        }
开发者ID:GeorgeR,项目名称:DynamoIOC,代码行数:8,代码来源:LifetimeExtensions.cs


示例16: Add

 public static void Add(string key, object o, int time, TimeSpan timespan, CacheItemPriority priority, CacheItemRemovedCallback callback)
 {
     if (o == null)
     {
         return;
     }
     _cache.Insert(key, o, null, DateTime.Now.AddSeconds(time), timespan, priority, callback);
 }
开发者ID:shaohaiou,项目名称:comopp,代码行数:8,代码来源:MangaCache.cs


示例17: Insert

        /// <summary>
        /// 插入缓存
        /// </summary>
        /// <param name="key">Key</param>
        /// <param name="obj">缓存对象</param>
        /// <param name="dep"></param>
        /// <param name="seconds"></param>
        /// <param name="priority"></param>
        public static void Insert(string key, object obj, CacheDependency dep, int minuts, CacheItemPriority priority)
        {
            if (obj != null)
            {
                cache.Insert(key, obj, dep, DateTime.Now.AddMinutes(minuts), TimeSpan.Zero, priority, null);
            }

        }
开发者ID:JuRogn,项目名称:OA,代码行数:16,代码来源:CacheOperate.cs


示例18: Insert

		public void Insert(string Key, object Obj, CacheDependency Dependency, double TimeOut, TimeSpan SlidingExpiration, CacheItemPriority Priority, CacheItemRemovedCallback RemovedCallback)
		{
			if ((Obj != null)) {
				Cache Cache = HttpRuntime.Cache;
				if (Cache [Key] == null) {
					Cache.Insert(Key, RuntimeHelpers.GetObjectValue(Obj), Dependency, DateTime.Now.AddSeconds(TimeOut), SlidingExpiration, Priority, RemovedCallback);
				}
			}
		}
开发者ID:Aaronguo,项目名称:Fx.InformationPlatform.,代码行数:9,代码来源:CacheManager.cs


示例19: AddObject

 public static void AddObject(string CacheKey, object value, CacheItemPriority cacheItemPriority = 0)
 {
     CheckFile();
     if (Convert.ToInt32(cacheItemPriority) == 0)
     {
         cacheItemPriority = _CacheItemPriority;
     }
     HttpContext.Current.Cache.Add(CacheKey, value, _CacheDependency, Expiration, Cache.NoSlidingExpiration, cacheItemPriority, null);
 }
开发者ID:ajhCMS,项目名称:AJH.CMS.WEB.UI,代码行数:9,代码来源:CacheManager.cs


示例20: RedisCacheEntry

 public RedisCacheEntry(String key,
                           Object value,
                           DateTimeOffset absExp,
                           TimeSpan slidingExp,
                           CacheItemPriority priority)
     : base(key)
 {
     Value = value;
     State = new RedisCacheEntryState(absExp, slidingExp, priority, value.GetType().AssemblyQualifiedName);
 }
开发者ID:braegelno5,项目名称:Redis-Object-Cache,代码行数:10,代码来源:RedisCacheEntry.cs



注:本文中的CacheItemPriority类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# CacheItemRemovedCallback类代码示例发布时间:2022-05-24
下一篇:
C# CacheItem类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap