[3742] | 1 | #region License Information
|
---|
| 2 | /* HeuristicLab
|
---|
[12012] | 3 | * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
|
---|
[3742] | 4 | *
|
---|
| 5 | * This file is part of HeuristicLab.
|
---|
| 6 | *
|
---|
| 7 | * HeuristicLab is free software: you can redistribute it and/or modify
|
---|
| 8 | * it under the terms of the GNU General Public License as published by
|
---|
| 9 | * the Free Software Foundation, either version 3 of the License, or
|
---|
| 10 | * (at your option) any later version.
|
---|
| 11 | *
|
---|
| 12 | * HeuristicLab is distributed in the hope that it will be useful,
|
---|
| 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
| 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
---|
| 15 | * GNU General Public License for more details.
|
---|
| 16 | *
|
---|
| 17 | * You should have received a copy of the GNU General Public License
|
---|
| 18 | * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
|
---|
| 19 | */
|
---|
| 20 | #endregion
|
---|
| 21 |
|
---|
| 22 | using System;
|
---|
[3736] | 23 | using System.Collections.Generic;
|
---|
| 24 | using System.Linq;
|
---|
[4068] | 25 | using System.Reflection;
|
---|
[3736] | 26 | using System.Windows.Forms;
|
---|
| 27 |
|
---|
[13338] | 28 | namespace HeuristicLab.PluginInfrastructure.UI {
|
---|
[3736] | 29 | /// <summary>
|
---|
| 30 | /// Shows product, version and copyright information for HeuristicLab and all plugins.
|
---|
| 31 | /// </summary>
|
---|
| 32 | public partial class AboutDialog : Form {
|
---|
[13363] | 33 | private List<IPluginDescription> plugins;
|
---|
| 34 |
|
---|
[3736] | 35 | /// <summary>
|
---|
[13363] | 36 | /// Creates a new about dialog listing all plugins in the <paramref name="plugins"/> enumerable.
|
---|
[3736] | 37 | /// </summary>
|
---|
[13363] | 38 | /// <param name="plugins">Enumerable of plugins that should be listed.</param>
|
---|
[13369] | 39 | public AboutDialog(IEnumerable<IPluginDescription> plugins, Assembly mainAssembly) {
|
---|
[3736] | 40 | InitializeComponent();
|
---|
[13369] | 41 |
|
---|
| 42 | productTextBox.Text = mainAssembly.GetProduct();
|
---|
| 43 | versionTextBox.Text = mainAssembly.GetFileVersion();
|
---|
| 44 | copyrightTextBox.Text = mainAssembly.GetCopyright();
|
---|
[13338] | 45 | imageList.Images.Add(Resources.Plugin);
|
---|
| 46 | pictureBox.Image = Resources.HeuristicLabLogo;
|
---|
| 47 | licenseTextBox.Text = Resources.LicenseText;
|
---|
[13363] | 48 | this.plugins = plugins.ToList();
|
---|
[3736] | 49 | ActiveControl = okButton;
|
---|
| 50 | }
|
---|
| 51 |
|
---|
| 52 | /// <summary>
|
---|
[13363] | 53 | /// Creates a new about dialog with all plugins loaded in the current application.
|
---|
[3736] | 54 | /// </summary>
|
---|
[13363] | 55 | public AboutDialog()
|
---|
[13369] | 56 | : this(ApplicationManager.Manager.Plugins, typeof(IPluginDescription).Assembly) {
|
---|
[3736] | 57 | }
|
---|
| 58 |
|
---|
| 59 | private void okButton_Click(object sender, EventArgs e) {
|
---|
| 60 | Close();
|
---|
| 61 | }
|
---|
[3742] | 62 |
|
---|
| 63 | private void licenseTextBox_LinkClicked(object sender, LinkClickedEventArgs e) {
|
---|
| 64 | System.Diagnostics.Process.Start(e.LinkText);
|
---|
| 65 | }
|
---|
| 66 |
|
---|
[3761] | 67 | private void webLinkLabel_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) {
|
---|
| 68 | System.Diagnostics.Process.Start(webLinkLabel.Text);
|
---|
[3742] | 69 | }
|
---|
[3761] | 70 |
|
---|
| 71 | private void mailLinkLabel_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) {
|
---|
| 72 | System.Diagnostics.Process.Start("mailto:" + mailLinkLabel.Text);
|
---|
| 73 | }
|
---|
[13363] | 74 |
|
---|
| 75 | private void showPluginsButton_Click(object sender, EventArgs e) {
|
---|
| 76 | var d = new PluginInformationDialog(plugins);
|
---|
| 77 | d.ShowDialog(this);
|
---|
| 78 | }
|
---|
[3736] | 79 | }
|
---|
| 80 | }
|
---|