/// <summary> /// Removes the settings for given plugin from the cache. /// </summary> /// <param name="plugin">The plugin to remove the cached settings for.</param> public void RemovePluginSettings(TextPlugin plugin) { _cache.Remove(CacheKeys.PluginSettingsKey(plugin)); }
/// <summary> /// Gets the plugin settings. /// </summary> /// <param name="plugin">The text plugin.</param> /// <returns> /// Returns the <see cref="Settings" /> or null if the plugin is not in the cache. /// </returns> public PluginSettings GetPluginSettings(TextPlugin plugin) { return(_cache.Get(CacheKeys.PluginSettingsKey(plugin)) as PluginSettings); }
/// <summary> /// Updates the plugin settings. /// </summary> /// <param name="plugin">The text plugin.</param> public void UpdatePluginSettings(TextPlugin plugin) { _cache.Remove(CacheKeys.PluginSettingsKey(plugin)); _cache.Add(CacheKeys.PluginSettingsKey(plugin), plugin.Settings, new CacheItemPolicy()); }