#region License
// Copyright 2005-2019 Paul Kohler (https://github.com/paulkohler/minisqlquery). All rights reserved.
// This source code is made available under the terms of the GNU Lesser General Public License v3.0
// https://github.com/paulkohler/minisqlquery/blob/master/LICENSE
#endregion
namespace MiniSqlQuery.Core
{
///
/// A simple base class to use for implementing the interface.
///
public abstract class PluginLoaderBase : IPlugIn
{
///
/// Initializes a new instance of the class. Creates a new instance of a plugin loader class.
///
/// The descriptive name of the plugin
/// A brief description of the plugin.
///
/// The defaults to 1000.
///
protected PluginLoaderBase(string name, string description)
: this(name, description, 1000)
{
}
///
/// Initializes a new instance of the class. Creates a new instance of a plugin loader class.
///
/// The descriptive name of the plugin
/// A brief description of the plugin.
/// The requested load order. See .
protected PluginLoaderBase(string name, string description, int requestedLoadOrder)
{
PluginName = name;
PluginDescription = description;
RequestedLoadOrder = requestedLoadOrder;
}
///
/// Gets a brief description of the plugin.
///
/// The plugin description.
public string PluginDescription { get; private set; }
///
/// Gets the descriptive name of the plugin.
///
/// The plugin name.
public string PluginName { get; private set; }
///
/// Gets the "order" value for a lame ordering system.
/// TODO: needs to be replaced with Windsor containter etc.
///
/// The requested load order.
public int RequestedLoadOrder { get; private set; }
///
/// Gets a reference to the applications service manager.
///
/// The services.
public IApplicationServices Services { get; private set; }
///
/// Must be implemented by the inheriting class.
/// Called after the application has started.
///
public abstract void InitializePlugIn();
///
/// Called when the plugins are loading during application startup.
/// Stores the reference to .
///
/// The application services intance.
public void LoadPlugIn(IApplicationServices services)
{
Services = services;
}
///
/// Called as the application is shutting down.
///
///
/// In most cases there is probably no need to do anything here, all controls etc created
/// will be disposed of implicitly. It would only be unmanaged references created explicitly
/// by the plugin that would need removal or cleanup.
///
public virtual void UnloadPlugIn()
{
}
}
}