Image Resizer : API Documentation

Type PluginConfig

Namespace ImageResizer.Configuration

Parent IssueSink

Interfaces IEncoderProvider

Public instance methods

void add_plugin(IPlugin plugin)

Only for use by plugins during IPlugin.Install. Call Plugin.Install instead of this method, since plugins often must perform other initialization actions. Adds the specified plugin to AllPlugins, QuerystringPlugins, CachingSystems, ImageEncoders, and ImageBuiderExtensions, based on which interfaces the instance implements. For ICache and IEncoder, the plugin is inserted at the beginning of CachingSystems and ImageEncoders respectively. To reiterate, plugins may register event handlers and modify settings - thus you should use the plugin's method to uninstall them vs. using this method. Will not register a plugin that is already installed, unless it implementes IMultiInstancePlugin.

Type FindPluginType(string searchName)

Searches all loaded assemblies for the specified type, applying rules and prefixes to resolve the namespace and assembly. Returns null if it could not find the type, and logs an issue.

void ForceLoadPlugins()

Forces loading of the plugins specified in configuration, even if they have already been loaded. Will add duplicate plugins and throw exceptions if you do not call RemoveAll() first.

T Get<T>()

Returns the first registerd instance of the specified plugin. For IMultiInstancePlugins, use GetAll()

IList<T> GetAll<T>()

Returns all registered instances of the specified plugins

T GetOrInstall<T>(T newInstance)

Returns the first registered instance of the specified plugin, or installs the given instance instead, then re-tries the query

T GetOrInstall<T>()

Returns the first registered instance of the specified plugin, or creates a new instance if the plugin isn't installed.

IList<IPlugin> GetPlugins(Type type)

Returns the subset of installed plugins which implement the specified type or interface

bool Has<T>()

Returns true if 1 or more instances of the type are registered.

bool HasPlugin(Type type)

Returns true if at least one plugin of the specified type is registered.

IPlugin Install(IPlugin plugin)

Installs the specified plugin, returning the plugin instance. Convenience method, same as plugin.Install(Config.Current).

void LoadPlugins()

Processes the section if they are not already loaded. Thread safe. Only executes once.

void remove_plugin(object plugin)

For use only by plugins during.Uninstall. Removes the specified plugin from AllPlugins, QuerystringPlugins, CachingSystems, ImageEncoders, and ImageBuiderExtensions, based on which interfaces the instance implements. Plugins may register event handlers and modify settings - thus you should use the plugin's method to uninstall them vs. using this method.

void RemoveAll()

Removes all plugins, of every kind. Logs any errors encountered. (Not all plugins support uninstallation)

bool Uninstall(IPlugin plugin)

Attempts uninstallation of the specified plugin, returning true if successful. Convenience method, same as plugin.Uninstall(Config.Current).

Public properties

SafeList<T> AllPlugins get;

All plugins should be registered here. Used for diagnostic purposes.

SafeList<T> CachingSystems get;

Currently registered ICache instances

SafeList<T> ConfigProviders get;

Currently registered ICurrentConfigProviders.

IEncoderProvider EncoderProvider get;

SafeList<T> FileExtensionPlugins get;

Plugins which accept new file extensions (in the url) are registered here.

SafeList<T> ImageBuilderExtensions get;

Currently registered set of ImageBuilderExtensions.

SafeList<T> ImageEncoders get;

Currently registered IEncoders.

ILogManager LogManager get; set;

Returns the most recently registered Logging plugin, or null.

bool PluginsLoaded get;

Returns true if the section has been processed

SafeList<T> QuerystringPlugins get;

Plugins which accept querystring arguments are registered here.

SafeList<T> SettingsModifierPlugins get;

Plugins which modify image processing settings.

SafeList<T> VirtualProviderPlugins get;

Plugins which provide virtual files are registered here.

Public fields

LoggingAvaialableEvent LoggingAvailable