internal CacheEntry(string key, object value, CacheDependency dependency, CacheItemRemovedCallback onRemovedHandler, DateTime utcAbsoluteExpiration, TimeSpan slidingExpiration, CacheItemPriority priority, bool isPublic) : base(key, isPublic) { if (value == null) { throw new ArgumentNullException("value"); } if ((slidingExpiration < TimeSpan.Zero) || (OneYear < slidingExpiration)) { throw new ArgumentOutOfRangeException("slidingExpiration"); } if ((utcAbsoluteExpiration != Cache.NoAbsoluteExpiration) && (slidingExpiration != Cache.NoSlidingExpiration)) { throw new ArgumentException(System.Web.SR.GetString("Invalid_expiration_combination")); } if ((priority < CacheItemPriority.Low) || (CacheItemPriority.NotRemovable < priority)) { throw new ArgumentOutOfRangeException("priority"); } this._value = value; this._dependency = dependency; this._onRemovedTargets = onRemovedHandler; this._utcCreated = DateTime.UtcNow; this._slidingExpiration = slidingExpiration; if (this._slidingExpiration > TimeSpan.Zero) { this._utcExpires = this._utcCreated + this._slidingExpiration; } else { this._utcExpires = utcAbsoluteExpiration; } this._expiresEntryRef = System.Web.Caching.ExpiresEntryRef.INVALID; this._expiresBucket = 0xff; this._usageEntryRef = System.Web.Caching.UsageEntryRef.INVALID; if (priority == CacheItemPriority.NotRemovable) { this._usageBucket = 0xff; } else { this._usageBucket = (byte)(priority - 1); } }
internal CacheEntry(string key, object value, CacheDependency dependency, CacheItemRemovedCallback onRemovedHandler, DateTime utcAbsoluteExpiration, TimeSpan slidingExpiration, CacheItemPriority priority, bool isPublic) : base(key, isPublic) { if (value == null) { throw new ArgumentNullException("value"); } if ((slidingExpiration < TimeSpan.Zero) || (OneYear < slidingExpiration)) { throw new ArgumentOutOfRangeException("slidingExpiration"); } if ((utcAbsoluteExpiration != Cache.NoAbsoluteExpiration) && (slidingExpiration != Cache.NoSlidingExpiration)) { throw new ArgumentException(System.Web.SR.GetString("Invalid_expiration_combination")); } if ((priority < CacheItemPriority.Low) || (CacheItemPriority.NotRemovable < priority)) { throw new ArgumentOutOfRangeException("priority"); } this._value = value; this._dependency = dependency; this._onRemovedTargets = onRemovedHandler; this._utcCreated = DateTime.UtcNow; this._slidingExpiration = slidingExpiration; if (this._slidingExpiration > TimeSpan.Zero) { this._utcExpires = this._utcCreated + this._slidingExpiration; } else { this._utcExpires = utcAbsoluteExpiration; } this._expiresEntryRef = System.Web.Caching.ExpiresEntryRef.INVALID; this._expiresBucket = 0xff; this._usageEntryRef = System.Web.Caching.UsageEntryRef.INVALID; if (priority == CacheItemPriority.NotRemovable) { this._usageBucket = 0xff; } else { this._usageBucket = (byte) (priority - 1); } }