コード例 #1
0
ファイル: Sequences.cs プロジェクト: kumpera/mono
		static CacheItem CreateCacheItem (XPathNavigator node, Dictionary <Guid, int> cacheIndex, List <CacheItem> cacheItems)
		{
			Guid guid = node.GetRequiredAttribute <Guid> ("guid");
			int idx;

			if (cacheIndex.TryGetValue (guid, out idx))
				return cacheItems [idx];
			
			var ret = new CacheItem ();

			ret.Key = node.GetRequiredAttribute <string> ("key");
			ret.AbsoluteExpiration = node.GetRequiredAttribute <DateTime> ("absoluteExpiration");
			ret.SlidingExpiration = node.GetRequiredAttribute <TimeSpan> ("slidingExpiration");
			ret.Priority = node.GetRequiredAttribute <CacheItemPriority> ("priority");
			ret.LastChange = node.GetRequiredAttribute <DateTime> ("lastChange");
			ret.ExpiresAt = node.GetRequiredAttribute <long> ("expiresAt");
			ret.Disabled = node.GetRequiredAttribute <bool> ("disabled");
			ret.Guid = guid;

			cacheItems.Add (ret);
			cacheIndex.Add (guid, cacheItems.Count - 1);
			
			return ret;
		}