/// <summary>
        /// Clears the specified type from cache so it will be evaluated.
        /// </summary>
        /// <param name="type">The type.</param>
        /// <exception cref="ArgumentNullException">The <paramref name="type"/> is <c>null</c>.</exception>
        public void Clear(Type type)
        {
            Argument.IsNotNull("type", type);

            lock (_lock)
            {
                _fieldsToSerializeCache.Remove(type);
                _catelPropertiesToSerializeCache.Remove(type);
                _regularPropertiesToSerializeCache.Remove(type);

                var key1 = GetCacheKey(type, true);
                var key2 = GetCacheKey(type, false);

                _catelPropertyNamesCache.Remove(key1);
                _catelPropertyNamesCache.Remove(key2);
                _catelPropertiesCache.Remove(key1);
                _catelPropertiesCache.Remove(key2);

                _regularPropertyNamesCache.Remove(type);
                _regularPropertiesCache.Remove(type);

                _fieldNamesCache.Remove(type);
                _fieldsCache.Remove(type);

                _serializerModifierCache.Remove(type);
                _serializationModifiersPerTypeCache.Remove(type);
            }

            CacheInvalidated.SafeInvoke(this, new CacheInvalidatedEventArgs(type));
        }
Beispiel #2
0
 private void Invalidate()
 {
     if (!isInvalidating)
     {
         isInvalidating = true;
         LastUpdatedAt  = DateTimeOffset.MinValue;
         CacheInvalidated.SafeInvoke(CacheType);
     }
 }
Beispiel #3
0
 public void InvalidateData()
 {
     if (!isInvalidating)
     {
         Logger.Trace("Invalidate");
         isInvalidating = true;
         LastUpdatedAt  = DateTimeOffset.MinValue;
         CacheInvalidated.SafeInvoke(CacheType);
     }
 }
Beispiel #4
0
 private void OnCacheInvalidated(CacheType cacheType)
 {
     CacheInvalidated.SafeInvoke(cacheType);
 }
Beispiel #5
0
 private void OnCacheInvalidated(CacheType cacheType)
 {
     Logger.Trace("OnCacheInvalidated cacheType:{0}", cacheType);
     CacheInvalidated.SafeInvoke(cacheType);
 }
Beispiel #6
0
 public void InvalidateData()
 {
     Logger.Trace("Invalidate");
     CacheInvalidated.SafeInvoke();
     SaveData(DateTimeOffset.Now, false);
 }
Beispiel #7
0
 public void InvalidateData()
 {
     Logger.Trace("Invalidate");
     CacheInvalidated.SafeInvoke();
 }