CP-38529: Make PluginManager public in MainWindow.cs

To allow to open the Options page from other forms

Signed-off-by: Danilo Del Busso <Danilo.Del.Busso@citrix.com>
This commit is contained in:
Danilo Del Busso 2021-11-29 15:18:38 +00:00 committed by Danilo Del Busso
parent 3956502063
commit 495dcd66d4
2 changed files with 14 additions and 14 deletions

View File

@ -15,7 +15,7 @@ namespace XenAdmin
{
Program.Exiting = true;
pluginManager.PluginsChanged -= pluginManager_PluginsChanged;
PluginManager.PluginsChanged -= pluginManager_PluginsChanged;
UnRegisterEvents();
if (disposing)
@ -23,7 +23,7 @@ namespace XenAdmin
if (components != null)
components.Dispose();
pluginManager.Dispose();
PluginManager.Dispose();
log.Debug("MainWindow disposing of license timer");
if (licenseTimer != null)

View File

@ -128,7 +128,7 @@ namespace XenAdmin
private static readonly System.Windows.Forms.Timer CheckForUpdatesTimer = new System.Windows.Forms.Timer();
private readonly PluginManager pluginManager;
public readonly PluginManager PluginManager;
private readonly ContextMenuBuilder contextMenuBuilder;
private readonly LicenseManagerLauncher licenseManagerLauncher;
@ -220,11 +220,11 @@ namespace XenAdmin
CommandLineArgType = argType;
CommandLineParam = args;
pluginManager = new PluginManager();
pluginManager.PluginsChanged += pluginManager_PluginsChanged;
pluginManager.LoadPlugins();
contextMenuBuilder = new ContextMenuBuilder(pluginManager, this);
((WinformsXenAdminConfigProvider) XenAdminConfigManager.Provider).PluginManager = pluginManager;
PluginManager = new PluginManager();
PluginManager.PluginsChanged += pluginManager_PluginsChanged;
PluginManager.LoadPlugins();
contextMenuBuilder = new ContextMenuBuilder(PluginManager, this);
((WinformsXenAdminConfigProvider) XenAdminConfigManager.Provider).PluginManager = PluginManager;
FormFontFixer.Fix(this);
@ -634,7 +634,7 @@ namespace XenAdmin
if (result && dlg.IsCheckBoxChecked)
{
using (var dialog = new OptionsDialog(pluginManager))
using (var dialog = new OptionsDialog(PluginManager))
{
dialog.SelectConnectionOptionsPage();
dialog.ShowDialog(this);
@ -1190,7 +1190,7 @@ namespace XenAdmin
}
selectedTabs.Remove(o);
pluginManager.DisposeURLs(o);
PluginManager.DisposeURLs(o);
}
}
@ -1578,7 +1578,7 @@ namespace XenAdmin
consoleFeatures = new List<TabPageFeature>();
otherFeatures = new List<TabPageFeature>();
var plugins = pluginManager.Plugins;
var plugins = PluginManager.Plugins;
foreach (var p in plugins)
{
var features = p.Features;
@ -1703,7 +1703,7 @@ namespace XenAdmin
bool itemAdded = false;
// add plugin items for this menu at insertIndex
foreach (PluginDescriptor plugin in pluginManager.Plugins)
foreach (PluginDescriptor plugin in PluginManager.Plugins)
{
if (!plugin.Enabled)
continue;
@ -2118,7 +2118,7 @@ namespace XenAdmin
private void UpdateTabePageFeatures()
{
var plugins = pluginManager.Plugins;
var plugins = PluginManager.Plugins;
foreach (var p in plugins)
{
var features = p.Features;
@ -2689,7 +2689,7 @@ namespace XenAdmin
private void preferencesToolStripMenuItem_Click(object sender, EventArgs e)
{
using (var dialog = new OptionsDialog(pluginManager))
using (var dialog = new OptionsDialog(PluginManager))
dialog.ShowDialog(this);
}