#region License Information
/* HeuristicLab
* Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
*
* This file is part of HeuristicLab.
*
* HeuristicLab is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* HeuristicLab is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with HeuristicLab. If not, see .
*/
#endregion
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Windows.Forms;
namespace HeuristicLab.PluginInfrastructure.UI {
///
/// Shows product, version and copyright information for HeuristicLab and all plugins.
///
public partial class AboutDialog : Form {
private List plugins;
///
/// Creates a new about dialog listing all plugins in the enumerable.
///
/// Enumerable of plugins that should be listed.
public AboutDialog(IEnumerable plugins, Assembly mainAssembly) {
InitializeComponent();
productTextBox.Text = mainAssembly.GetProduct();
versionTextBox.Text = mainAssembly.GetFileVersion();
copyrightTextBox.Text = mainAssembly.GetCopyright();
imageList.Images.Add(Resources.Plugin);
pictureBox.Image = Resources.HeuristicLabLogo;
licenseTextBox.Text = Resources.LicenseText;
this.plugins = plugins.ToList();
ActiveControl = okButton;
}
///
/// Creates a new about dialog with all plugins loaded in the current application.
///
public AboutDialog()
: this(ApplicationManager.Manager.Plugins, typeof(IPluginDescription).Assembly) {
}
private void okButton_Click(object sender, EventArgs e) {
Close();
}
private void licenseTextBox_LinkClicked(object sender, LinkClickedEventArgs e) {
System.Diagnostics.Process.Start(e.LinkText);
}
private void webLinkLabel_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) {
System.Diagnostics.Process.Start(webLinkLabel.Text);
}
private void mailLinkLabel_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) {
System.Diagnostics.Process.Start("mailto:" + mailLinkLabel.Text);
}
private void showPluginsButton_Click(object sender, EventArgs e) {
var d = new PluginInformationDialog(plugins);
d.ShowDialog(this);
}
}
}