Class CacheDependency
Tracks cache dependencies, which can be files, directories, or keys to other objects in application's cache. This class cannot be inherited.
Inheritance
Assembly: Alachisoft.NCache.Runtime.dll
Syntax
[Serializable]
[Obsolete("This API is deprecated and will be removed in a future release. This feature is being retired and will not be continued in future versions.", false)]
public class CacheDependency : IDisposable, IBinaryProtocolSerializable
Remarks
You can add items with dependencies to your application's cache with the Add and Insert methods.
When you add an item to an application's cache object and, in doing so, define a cache dependency for that item, an instance of the CacheDependency class is created automatically to track changes to the files, keys, or directories you have specified. This helps you avoid losing changes made to the object between the time it is created and the time it is inserted into the cache. The CacheDependency instance can represent a single file or directory, an array of files or directories, or an array of files or directories along with an array of cache keys (these represent other items stored in the cache object).
Constructors
| Name | Description |
|---|---|
| CacheDependency() | Default constructor for CacheDependency class. |
| CacheDependency(CustomDependency) | Creates a CacheDependency instance from Custom Dependency. |
| CacheDependency(ExtensibleDependency) | Creates a CacheDependency instance from Extensible Dependency. |
| CacheDependency(String) | Initializes a new instance of the CacheDependency class that monitors a file or directory for changes. |
| CacheDependency(String, DateTime) | Initializes a new instance of the CacheDependency class that monitors a file or directory for changes and indicates when change tracking is to begin. |
| CacheDependency(String[]) | Initializes a new instance of the CacheDependency class that monitors an array of file paths (to files or directories) for changes. |
| CacheDependency(String[], DateTime) | Initializes a new instance of the CacheDependency class that monitors an array of file paths (to files or directories) for changes and specifies a time when change monitoring begins. |
| CacheDependency(String[], String[]) | Initializes a new instance of the CacheDependency class that monitors an array of file paths (to files or directories), an array of cache keys, or both for changes. |
| CacheDependency(String[], String[], CacheDependency) | Initializes a new instance of the CacheDependency class that monitors an array of file paths (to files or directories), an array of cache keys, or both for changes. It also makes itself dependent upon a separate instance of the CacheDependency class. |
| CacheDependency(String[], String[], CacheDependency, DateTime) | Initializes a new instance of the CacheDependency class that monitors an array of file paths (to files or directories), an array of cache keys, or both for changes. It also makes itself dependent upon another instance of the CacheDependency class and a time when the change monitoring begins. |
| CacheDependency(String[], String[], DateTime) | Initializes a new instance of the CacheDependency class that monitors an array of file paths (to files or directories), an array of cache keys, or both for changes. |
Fields
| Name | Description |
|---|---|
| DEPENDENCY_COUNT_OVERHEAD | |
| DEPENDENCY_TYPE_OVERHEAD | |
| sizeInBytes |
Properties
| Name | Description |
|---|---|
| Dependencies | Contains the list of dependencies for the cache item. |
Methods
| Name | Description |
|---|---|
| AddDependencies(CacheDependency[]) | This method is used to add dependencies for the cache item. |
| DependencyDispose() | Releases custom resources used by the CacheDependency object. |
| Dispose() | Releases the resources used by the CacheDependency object. |