Changeset 13363 for branches/RefactorPluginInfrastructure-2522/HeuristicLab.PluginInfrastructure.UI/AboutDialog.cs
- Timestamp:
- 11/24/15 16:34:17 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/RefactorPluginInfrastructure-2522/HeuristicLab.PluginInfrastructure.UI/AboutDialog.cs
r13353 r13363 31 31 /// </summary> 32 32 public partial class AboutDialog : Form { 33 private List<IPluginDescription> plugins; 34 33 35 /// <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. 35 37 /// </summary> 36 public AboutDialog() { 38 /// <param name="plugins">Enumerable of plugins that should be listed.</param> 39 public AboutDialog(IEnumerable<IPluginDescription> plugins) { 37 40 InitializeComponent(); 38 41 var entryAssembly = Assembly.GetEntryAssembly(); … … 43 46 pictureBox.Image = Resources.HeuristicLabLogo; 44 47 licenseTextBox.Text = Resources.LicenseText; 45 UpdatePluginList(ApplicationManager.Manager.Plugins);48 this.plugins = plugins.ToList(); 46 49 ActiveControl = okButton; 47 50 } 48 51 49 52 /// <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. 51 54 /// </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) { 65 57 } 66 58 … … 91 83 92 84 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 }97 85 } 98 86 … … 108 96 System.Diagnostics.Process.Start("mailto:" + mailLinkLabel.Text); 109 97 } 98 99 private void showPluginsButton_Click(object sender, EventArgs e) { 100 var d = new PluginInformationDialog(plugins); 101 d.ShowDialog(this); 102 } 110 103 } 111 104 }
Note: See TracChangeset
for help on using the changeset viewer.