Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
11/24/15 16:34:17 (8 years ago)
Author:
gkronber
Message:

#2522: improvements to new PluginInformationDialog and removed obsolete classes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/RefactorPluginInfrastructure-2522/HeuristicLab.PluginInfrastructure.UI/AboutDialog.cs

    r13353 r13363  
    3131  /// </summary>
    3232  public partial class AboutDialog : Form {
     33    private List<IPluginDescription> plugins;
     34
    3335    /// <summary>
    34     /// Creates a new about dialog with all plugins loaded in the current application.
     36    /// Creates a new about dialog listing all plugins in the <paramref name="plugins"/> enumerable.
    3537    /// </summary>
    36     public AboutDialog() {
     38    /// <param name="plugins">Enumerable of plugins that should be listed.</param>
     39    public AboutDialog(IEnumerable<IPluginDescription> plugins) {
    3740      InitializeComponent();
    3841      var entryAssembly = Assembly.GetEntryAssembly();
     
    4346      pictureBox.Image = Resources.HeuristicLabLogo;
    4447      licenseTextBox.Text = Resources.LicenseText;
    45       UpdatePluginList(ApplicationManager.Manager.Plugins);
     48      this.plugins = plugins.ToList();
    4649      ActiveControl = okButton;
    4750    }
    4851
    4952    /// <summary>
    50     /// Creates a new about dialog listing all plugins in the <paramref name="plugins"/> enumerable.
     53    /// Creates a new about dialog with all plugins loaded in the current application.
    5154    /// </summary>
    52     /// <param name="plugins">Enumerable of plugins that should be listed.</param>
    53     public AboutDialog(IEnumerable<IPluginDescription> plugins)
    54       : this() {
    55       UpdatePluginList(plugins);
    56     }
    57 
    58     private void UpdatePluginList(IEnumerable<IPluginDescription> plugins) {
    59       pluginListView.Items.Clear();
    60       foreach (var plugin in plugins) {
    61         ListViewItem pluginItem = CreateListViewItem(plugin);
    62         pluginListView.Items.Add(pluginItem);
    63       }
    64       Util.ResizeColumns(pluginListView.Columns.OfType<ColumnHeader>());
     55    public AboutDialog()
     56      : this(ApplicationManager.Manager.Plugins) {
    6557    }
    6658
     
    9183
    9284    private void pluginListView_ItemActivate(object sender, EventArgs e) {
    93       if (pluginListView.SelectedItems.Count > 0) {
    94         PluginView view = new PluginView((IPluginDescription)pluginListView.SelectedItems[0].Tag);
    95         view.Show(this);
    96       }
    9785    }
    9886
     
    10896      System.Diagnostics.Process.Start("mailto:" + mailLinkLabel.Text);
    10997    }
     98
     99    private void showPluginsButton_Click(object sender, EventArgs e) {
     100      var d = new PluginInformationDialog(plugins);
     101      d.ShowDialog(this);
     102    }
    110103  }
    111104}
Note: See TracChangeset for help on using the changeset viewer.