Changeset 13369 for branches/RefactorPluginInfrastructure-2522/HeuristicLab.PluginInfrastructure.UI/AboutDialog.cs
- Timestamp:
- 11/24/15 17:08:43 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/RefactorPluginInfrastructure-2522/HeuristicLab.PluginInfrastructure.UI/AboutDialog.cs
r13363 r13369 37 37 /// </summary> 38 38 /// <param name="plugins">Enumerable of plugins that should be listed.</param> 39 public AboutDialog(IEnumerable<IPluginDescription> plugins ) {39 public AboutDialog(IEnumerable<IPluginDescription> plugins, Assembly mainAssembly) { 40 40 InitializeComponent(); 41 var entryAssembly = Assembly.GetEntryAssembly(); 42 productTextBox.Text = GetProduct(entryAssembly);43 versionTextBox.Text = entryAssembly.GetFileVersion();44 copyrightTextBox.Text = GetCopyright(entryAssembly);41 42 productTextBox.Text = mainAssembly.GetProduct(); 43 versionTextBox.Text = mainAssembly.GetFileVersion(); 44 copyrightTextBox.Text = mainAssembly.GetCopyright(); 45 45 imageList.Images.Add(Resources.Plugin); 46 46 pictureBox.Image = Resources.HeuristicLabLogo; … … 54 54 /// </summary> 55 55 public AboutDialog() 56 : this(ApplicationManager.Manager.Plugins) { 57 } 58 59 private ListViewItem CreateListViewItem(IPluginDescription plugin) { 60 ListViewItem item = new ListViewItem(new string[] { plugin.Name, plugin.Version.ToString(), plugin.Description }); 61 item.Tag = plugin; 62 item.ImageIndex = 0; 63 return item; 64 } 65 66 private string GetCopyright(Assembly asm) { 67 AssemblyCopyrightAttribute attribute = GetAttribute<AssemblyCopyrightAttribute>(asm); 68 return attribute.Copyright; 69 } 70 71 private string GetProduct(Assembly asm) { 72 AssemblyProductAttribute attribute = GetAttribute<AssemblyProductAttribute>(asm); 73 return attribute.Product; 74 } 75 76 private T GetAttribute<T>(Assembly asm) { 77 return (T)asm.GetCustomAttributes(typeof(T), false).Single(); 56 : this(ApplicationManager.Manager.Plugins, typeof(IPluginDescription).Assembly) { 78 57 } 79 58 80 59 private void okButton_Click(object sender, EventArgs e) { 81 60 Close(); 82 }83 84 private void pluginListView_ItemActivate(object sender, EventArgs e) {85 61 } 86 62
Note: See TracChangeset
for help on using the changeset viewer.