Ejemplo n.º 1
0
        /// <summary>
        /// Invoked when a plugin has been installed.
        /// </summary>
        /// <remarks>
        /// Will add the plugin to the list of installed plugins for management.
        /// </remarks>
        /// <param name="sender">The sender of the event</param>
        /// <param name="e">The event data</param>
        private void PluginManager_Installed(object sender, PluginEventArgs e)
        {
            Dispatcher.Invoke(DispatcherPriority.Normal, new Action(delegate()
            {
                string icon = "pack://application:,,,/Platform/Windows 7/GUI/Images/Icons/";
                switch (e.Plugin.Type)
                {
                    case PluginType.Visualizer:
                        icon += "Visualizer.ico";
                        break;

                    case PluginType.Filter:
                        icon += "MidiSynth.ico";
                        break;

                    default:
                        icon += "Package.ico";
                        break;
                }
                if (PluginManager.GetListItem(e.Plugin.ID) == null)
                {
                    DateTime installed = DateTime.Now;
                    foreach (PluginSettings s in SettingsManager.PluginSettings)
                    {
                        if (s.PluginID == e.Plugin.ID && s.Installed != null)
                        {
                            installed = s.Installed;
                            break;
                        }
                    }

                    SettingsManager.Plugins.Add(new PluginItem()
                    {
                        ID = e.Plugin.ID,
                        Name = e.Plugin.T("Name"),
                        Description = e.Plugin.T("Description"),
                        Author = e.Plugin.Author,
                        URL = e.Plugin.Website,
                        Type = e.Plugin.Type,
                        Version = e.Plugin.Version,
                        Installed = installed,
                        Image = icon,
                        Icon = icon,
                        Disabled = true
                    });
                }
            }));
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Invoked when a plugin has been uninstalled.
 /// </summary>
 /// <remarks>
 /// Will remove the plugin from the list of installed plugins for management.
 /// </remarks>
 /// <param name="sender">The sender of the event</param>
 /// <param name="e">The event data</param>
 private void PluginManager_Uninstalled(object sender, PluginEventArgs e)
 {
     Dispatcher.Invoke(DispatcherPriority.Normal, new Action(delegate()
     {
         PluginItem p;
         if ((p = PluginManager.GetListItem(e.Plugin.ID)) != null)
             SettingsManager.Plugins.Remove(p);
     }));
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Invoked when a plugin has been uninstalled.
 /// </summary>
 /// <param name="sender">The sender of the event</param>
 /// <param name="e">The event data</param>
 private void PluginManager_Uninstalled(object sender, Core.PluginEventArgs e)
 {
     RefreshVisualizerVisibility();
 }