本文整理汇总了C#中PluginManager.LoadPlugins方法的典型用法代码示例。如果您正苦于以下问题:C# PluginManager.LoadPlugins方法的具体用法?C# PluginManager.LoadPlugins怎么用?C# PluginManager.LoadPlugins使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PluginManager
的用法示例。
在下文中一共展示了PluginManager.LoadPlugins方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Initialize
internal static void Initialize()
{
if (mGlobalInstance == null)
{
mGlobalInstance = new PluginManager(true);
mGlobalInstance.LoadPlugins(@"GlueView\Plugins");
}
if (mProjectInstance != null)
{
foreach (IPlugin plugin in ((PluginManager)mProjectInstance).mPluginContainers.Keys)
{
ShutDownPlugin(plugin, PluginShutDownReason.GlueShutDown);
}
}
mProjectInstance = new PluginManager(false);
mInstances.Clear();
mInstances.Add(mGlobalInstance);
mInstances.Add(mProjectInstance);
GluxManager.BeforeVariableSet += OnBeforeVariableSet;
GluxManager.AfterVariableSet += OnAfterVariableSet;
mProjectInstance.LoadPlugins(@"GlueView\Plugins");
}
示例2: PiscesForm
public PiscesForm(string fileName)
{
m_pluginManager = new PluginManager();
m_pluginManager.LoadPlugins();// loads assemblies into memory.
InitializeComponent();
InitializePisces(fileName);
m_pluginManager.RegisterPlugins(this.contextMenuStripTree.Items["AddMenu"]);
m_pluginManager.PluginClick += m_pluginManager_PluginClick;
Enabling();
}
示例3: RefreshPlugins
private void RefreshPlugins()
{
pluginManager = container.Resolve<PluginManager<IDataSourcePlugin>>("DataSourcePlugin");
pluginManager
//.FindPluginsInFolder("MyPluginFolder")
.LoadPlugins(plugin =>
{
// build the plugin UI.
BuildUI(plugin);
// Subscribe to the PluinDataSourceChange message.
messengerHub.Subscribe<PluginDatasourceChange>((message) =>
{
UpdateDataSourceInUI(message);
}, new ControlInvokeTinyMessageProxy(this)); // ensure that this message is invoked on the UI thread.
})
.RefreshUsingFileSystemWatcher((sender, eventHandler) =>
{
messengerHub.Publish<NewPluginDetected>(new NewPluginDetected());
});
}
示例4: OptionsDialog_Load
private void OptionsDialog_Load(object sender, EventArgs e)
{
var pManager = new PluginManager();
pManager.LoadPlugins();
foreach (var plugin in pManager.Plugins)
{
var title = ((AssemblyTitleAttribute)GetAssemblyAttribute(plugin.Assembly, typeof(AssemblyTitleAttribute))).Title;
var author = ((AssemblyCompanyAttribute)GetAssemblyAttribute(plugin.Assembly, typeof(AssemblyCompanyAttribute))).Company;
var version = plugin.Assembly.GetName().Version.ToString();
var item = new ListViewItem(title);
item.SubItems.Add(author);
item.SubItems.Add(version);
item.Checked = option.HiddenPlugins == null || !option.HiddenPlugins.Contains(title);
lvPlugins.Items.Add(item);
}
// Load proxy options
cbbProxyUsage.SelectedIndex = ConnectionManager.Instance.ConnectionsList.UseCustomProxy ? 2 : ConnectionManager.Instance.ConnectionsList.UseInternetExplorerProxy ? 1 : 0;
rbCustomAuthYes.Checked = !ConnectionManager.Instance.ConnectionsList.UseDefaultCredentials;
chkByPassProxyOnLocal.Checked = ConnectionManager.Instance.ConnectionsList.ByPassProxyOnLocal;
txtProxyAddress.Text = ConnectionManager.Instance.ConnectionsList.ProxyAddress;
txtProxyUser.Text = ConnectionManager.Instance.ConnectionsList.UserName;
txtProxyPassword.Text = ConnectionManager.Instance.ConnectionsList.Password;
cbbProxyUsage_SelectedIndexChanged(null, null);
}