CA-123576: Also reconstruct the plugin menu items when a plugin is enabled/disabled.

Signed-off-by: Konstantina Chremmou <konstantina.chremmou@citrix.com>
This commit is contained in:
Konstantina Chremmou 2014-01-02 09:10:57 +00:00
parent f120ffd496
commit 6e4c39ac96
2 changed files with 11 additions and 6 deletions

View File

@ -118,7 +118,7 @@ namespace XenAdmin.Dialogs.OptionsPages
#endregion
#region Control event handlers
#region Control event handlers
private void refreshButton_Click(object sender, EventArgs e)
{
@ -288,6 +288,7 @@ namespace XenAdmin.Dialogs.OptionsPages
Settings.UpdateDisabledPluginsList(disabled);
Program.MainWindow.UpdateToolbarsCore();
_pluginManager.OnPluginsChanged();
}
#endregion

View File

@ -104,6 +104,12 @@ namespace XenAdmin.Plugins
get { return (from PluginDescriptor plugin in _plugins where plugin.Enabled select plugin).Count(); }
}
public void OnPluginsChanged()
{
if (PluginsChanged != null)
PluginsChanged();
}
/// <summary>
/// Loads the plugins from the default Plugins folder.
/// </summary>
@ -154,9 +160,8 @@ namespace XenAdmin.Plugins
{
log.Error("Error loading plugins.", ex);
}
if (PluginsChanged != null)
PluginsChanged();
OnPluginsChanged();
}
}
@ -184,8 +189,7 @@ namespace XenAdmin.Plugins
}
_plugins.Clear();
if (PluginsChanged != null)
PluginsChanged();
OnPluginsChanged();
}
public void ReloadPlugins()