Click or drag to resize
IAircraftOnlineLookupManagerRegisterCache Method
Register a cache with the manager.

Namespace: VirtualRadar.Interface
Assembly: VirtualRadar.Interface (in VirtualRadar.Interface.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
void RegisterCache(
	IAircraftOnlineLookupCache cache,
	int priority,
	bool letManagerControlLifetime
)

Parameters

cache
Type: VirtualRadar.InterfaceIAircraftOnlineLookupCache
The cache to register.
priority
Type: SystemInt32
The relative priority of the cache. When the manager wants to save a record in the cache it uses higher value priority caches over lower values.
letManagerControlLifetime
Type: SystemBoolean
True if the manager should dispose of the cache when it shuts down, false if something else is looking after the cache's lifetime. Has no effect if the cache does not implement IDisposable.
Remarks

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.

See Also