KGy SOFT

LockingCacheOptions Class

KGy SOFT Core Libraries Help
Inheritance Hierarchy

SystemObject
  KGySoft.CollectionsThreadSafeCacheOptionsBase
    KGySoft.CollectionsLockingCacheOptions

Namespace:  KGySoft.Collections
Assembly:  KGySoft.CoreLibraries (in KGySoft.CoreLibraries.dll) Version: 6.0.0-rc.2
Syntax

public sealed class LockingCacheOptions : ThreadSafeCacheOptionsBase

The LockingCacheOptions type exposes the following members.

Constructors

  NameDescription
Public methodLockingCacheOptions
Initializes a new instance of the LockingCacheOptions class
Top
Properties

  NameDescription
Public propertyBehavior
Gets or sets the cache behavior when cache is full and an element has to be removed. The cache is full, when the number of stored items reaches Capacity. Default value: RemoveLeastRecentUsedElement.
Public propertyCapacity
Gets or sets the capacity of the cache to be created. If the cache is full, then the oldest or the least recent used element (depending on the Behavior property) will be dropped from the cache.
Default value: 1024.
Public propertyDisposeDroppedValues
Gets or sets whether dropped values are disposed if they implement IDisposable.
Default value: .
Public propertyExpiration
Gets or sets an expiration time for the values to be stored in the cache. If , then the values will not expire.
Default value: .
Remarks

Even if this property is , values might be reloaded from time to time because if the cache is full (see Capacity) oldest or least recent used elements (see Behavior) are dropped from the cache.

Depending on the targeted platform it is possible that values will not expire for at least 15 milliseconds.

Public propertyPreallocateCapacity
Gets or sets whether adding the first item to the cache should allocate memory the full cache Capacity. If , then the internal storage is dynamically reallocated while adding new elements until reaching Capacity. Set it to  if it is almost certain that the cache will be full when using it.
Default value: .
Public propertyProtectItemLoader
Gets or sets whether the item loader delegate that is specified by the ThreadSafeCacheFactory.Create<TKey, TValue> methods is protected from invoking it concurrently.
Default value: .
Top
Extension Methods

  NameDescription
Public Extension MethodConvert(Type, CultureInfo)Overloaded.
Converts an Object specified in the obj parameter to the desired targetType.
See the Examples section of the generic ConvertTTarget(Object, CultureInfo) overload for an example.
(Defined by ObjectExtensions.)
Public Extension MethodCode exampleConvertTTarget(CultureInfo)Overloaded.
Converts an Object specified in the obj parameter to the desired TTarget.
(Defined by ObjectExtensions.)
Public Extension MethodIn (Defined by ObjectExtensions.)
Public Extension MethodTryConvert(Type, Object)Overloaded.
Tries to convert an Object specified in the obj parameter to the desired targetType.
(Defined by ObjectExtensions.)
Public Extension MethodTryConvert(Type, CultureInfo, Object)Overloaded.
Tries to convert an Object specified in the obj parameter to the desired targetType.
(Defined by ObjectExtensions.)
Public Extension MethodTryConvertTTarget(TTarget)Overloaded.
Tries to convert an Object specified in the obj parameter to the desired TTarget.
See the Examples section of the ConvertTTarget(Object, CultureInfo) method for a related example.
(Defined by ObjectExtensions.)
Public Extension MethodTryConvertTTarget(CultureInfo, TTarget)Overloaded.
Tries to convert an Object specified in the obj parameter to the desired TTarget.
See the Examples section of the ConvertTTarget(Object, CultureInfo) method for a related example.
(Defined by ObjectExtensions.)
Top
See Also

Reference