Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
11/24/15 17:08:43 (9 years ago)
Author:
gkronber
Message:

#2522: improvements to AboutDialog and PluginInformationDialog

File:
1 edited

Legend:

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

    r13363 r13369  
    2323using System.Collections.Generic;
    2424using System.Drawing;
    25 using System.IO;
    2625using System.Linq;
    27 using System.Reflection;
    28 using System.Text.RegularExpressions;
    2926using System.Windows.Forms;
    3027
     
    3633    public PluginInformationDialog(IEnumerable<IPluginDescription> plugins) {
    3734      InitializeComponent();
    38       var entryAssembly = Assembly.GetEntryAssembly();
    39       productTextBox.Text = GetProduct(entryAssembly);
    40       versionTextBox.Text = entryAssembly.GetFileVersion();
    41       contactTextBox.Text = GetCopyright(entryAssembly);
    4235      imageList.Images.Add(Resources.Plugin);
    4336      textBox.Text = Resources.LicenseText;
    4437      PopulatePluginList(plugins);
     38
     39      // select first plugin to update plugin details
     40      pluginListView.Items[0].Selected = true;
     41      pluginListView.EnsureVisible(0);
     42
    4543      ActiveControl = okButton;
    4644    }
     
    6664      item.SubItems[2].Name = "Description";
    6765      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();
    8266    }
    8367
Note: See TracChangeset for help on using the changeset viewer.