本文整理汇总了C#中IPlugin.Initialize方法的典型用法代码示例。如果您正苦于以下问题:C# IPlugin.Initialize方法的具体用法?C# IPlugin.Initialize怎么用?C# IPlugin.Initialize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IPlugin
的用法示例。
在下文中一共展示了IPlugin.Initialize方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: InitializePlugin
private static void InitializePlugin(IPlugin plugin, string initializeString)
{
if (!string.IsNullOrEmpty(initializeString))
{
plugin.Initialize(initializeString);
}
}
示例2: LoadPlugin
/// <summary>
/// Loads a plugin into the PluginManager so that it can be managed by the server.
/// </summary>
/// <param name="plugin">The plugin to be loaded.</param>
public void LoadPlugin(IPlugin plugin)
{
//Event
PluginEnabledEventArgs e = new PluginEnabledEventArgs(plugin);
CallEvent(Event.PluginEnabled, e);
if (e.EventCanceled) return;
//End Event
lock (Plugins)
Plugins.Add(plugin);
try
{
OnPluginLoaded(plugin);
plugin.Associate(Server, this);
plugin.Initialize();
plugin.OnEnabled();
}
catch (Exception ex)
{
Server.Logger.Log(LogLevel.Fatal, plugin.Name + " cannot be loaded. It may be out of date.");
Server.Logger.Log(ex);
}
}
示例3: Initialize
// this would be a lot simpler if C# supported currying or typedefs
// default initialization
public virtual void Initialize (IPlugin plugin)
{
plugin.Initialize();
}
示例4: InitializePlugin
/// <summary>
/// initialize a single plugin
/// </summary>
/// <param name="plugin"></param>
private void InitializePlugin(IPlugin plugin)
{
plugin.Initialize(_configuration, QueueCommand);
}