Changeset 13369 for branches/RefactorPluginInfrastructure-2522/HeuristicLab.PluginInfrastructure.UI/PluginInformationDialog.cs
- Timestamp:
- 11/24/15 17:08:43 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/RefactorPluginInfrastructure-2522/HeuristicLab.PluginInfrastructure.UI/PluginInformationDialog.cs
r13363 r13369 23 23 using System.Collections.Generic; 24 24 using System.Drawing; 25 using System.IO;26 25 using System.Linq; 27 using System.Reflection;28 using System.Text.RegularExpressions;29 26 using System.Windows.Forms; 30 27 … … 36 33 public PluginInformationDialog(IEnumerable<IPluginDescription> plugins) { 37 34 InitializeComponent(); 38 var entryAssembly = Assembly.GetEntryAssembly();39 productTextBox.Text = GetProduct(entryAssembly);40 versionTextBox.Text = entryAssembly.GetFileVersion();41 contactTextBox.Text = GetCopyright(entryAssembly);42 35 imageList.Images.Add(Resources.Plugin); 43 36 textBox.Text = Resources.LicenseText; 44 37 PopulatePluginList(plugins); 38 39 // select first plugin to update plugin details 40 pluginListView.Items[0].Selected = true; 41 pluginListView.EnsureVisible(0); 42 45 43 ActiveControl = okButton; 46 44 } … … 66 64 item.SubItems[2].Name = "Description"; 67 65 return item; 68 }69 70 private string GetCopyright(Assembly asm) {71 AssemblyCopyrightAttribute attribute = GetAttribute<AssemblyCopyrightAttribute>(asm);72 return attribute.Copyright;73 }74 75 private string GetProduct(Assembly asm) {76 AssemblyProductAttribute attribute = GetAttribute<AssemblyProductAttribute>(asm);77 return attribute.Product;78 }79 80 private T GetAttribute<T>(Assembly asm) {81 return (T)asm.GetCustomAttributes(typeof(T), false).Single();82 66 } 83 67
Note: See TracChangeset
for help on using the changeset viewer.