System.Net.Cache.RequestCache.TryUpdate C# (CSharp) Method

TryUpdate() abstract private method

abstract private TryUpdate ( string key, System.DateTime expiresUtc, System.DateTime lastModifiedUtc, System.DateTime lastSynchronizedUtc, System.TimeSpan maxStale, StringCollection entryMetadata, StringCollection systemMetadata ) : bool
key string
expiresUtc System.DateTime
lastModifiedUtc System.DateTime
lastSynchronizedUtc System.DateTime
maxStale System.TimeSpan
entryMetadata System.Collections.Specialized.StringCollection
systemMetadata System.Collections.Specialized.StringCollection
return bool
        internal abstract bool    TryUpdate(
                                        string           key,
                                        DateTime         expiresUtc,
                                        DateTime         lastModifiedUtc,
                                        DateTime         lastSynchronizedUtc,
                                        TimeSpan         maxStale,
                                        StringCollection entryMetadata,
                                        StringCollection systemMetadata);
        

Usage Example

Example #1
0
        protected virtual void Dispose(bool disposing, CloseExState closeState)
        {
            try {
                if (Interlocked.Increment(ref _Disposed) == 1)
                {
                    if (disposing)
                    {
                        ICloseEx icloseEx = WrappedStream as ICloseEx;

                        if (icloseEx != null)
                        {
                            icloseEx.CloseEx(closeState);
                        }
                        else
                        {
                            WrappedStream.Close();
                        }

                        if (m_CacheDestroy)
                        {
                            if (m_IsStrictCacheErrors)
                            {
                                m_Cache.Remove(m_Key);
                            }
                            else
                            {
                                m_Cache.TryRemove(m_Key);
                            }
                        }
                        else
                        {
                            if (m_IsStrictCacheErrors)
                            {
                                m_Cache.Update(m_Key, m_Expires, m_LastModified, m_LastSynchronized, m_MaxStale, m_EntryMetadata, m_SystemMetadata);
                            }
                            else
                            {
                                m_Cache.TryUpdate(m_Key, m_Expires, m_LastModified, m_LastSynchronized, m_MaxStale, m_EntryMetadata, m_SystemMetadata);
                            }
                        }
                    }
                }
            }
            finally {
                base.Dispose(disposing);
            }
        }