SuperMap.Connector.CacheManager.GetCache C# (CSharp) Method

GetCache() public method

根据给定的key获取到一个对应的缓存。
public GetCache ( string key ) : object
key string 缓存的key。
return object
        public object GetCache(string key)
        {
            if (string.IsNullOrEmpty(key))
                throw new ArgumentNullException();
            if (this._cacheContent.ContainsKey(key))
            {
                CacheItem cacheItem = this._cacheContent[key];
                if (cacheItem != null)
                {
                    if (DateTime.Now.Subtract(cacheItem.CachedTime).TotalMilliseconds >= CacheManager.CacheDuration)
                    {
                        return null;
                    }
                    else
                    {
                        return cacheItem.Data;
                    }
                }
                else
                {
                    return null;
                }
            }
            else
            {
                return null;
            }
        }