IAircraftOnlineLookupManagerRegisterCache Method |
Namespace: VirtualRadar.Interface
void RegisterCache( IAircraftOnlineLookupCache cache, int priority, bool letManagerControlLifetime )
More than one cache can be registered with the manager. By default VRS registers a standalone cache with a priority of zero. This caches aircraft records in the configuration folder. If the database writer plugin is installed then that also registers a cache, this time with a priority of 100 so that it takes precedence over the standalone cache. This means that BaseStation.sqb is used as a cache in preferance to the standalone cache, but if the user does not enable the caching feature of the database writer (which is off by default) then the manager falls back to the standalone cache.
If you are writing a plugin that supplies a cache, and you want the cache to take precedence over the standard VRS caches, then use a priority that is higher than 100. If you want to only be used when the fallback cache is switched off then use a priority lower than 0.
The priority cannot be changed once the cache has been registered.
letManagerControlLifetime determines whether the Dispose method on the cache is called when the manager shuts down, usually when the program is closing. If the cache does not implement IDisposable then it has no effect.
This call does nothing if the cache has already been registered.