2019-11-27 11:33:00 +08:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.ComponentModel;
|
|
|
|
|
using System.Drawing;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Reflection;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
using System.Windows.Forms;
|
|
|
|
|
|
|
|
|
|
namespace AlmToolkit
|
|
|
|
|
{
|
|
|
|
|
partial class About : Form
|
|
|
|
|
{
|
2019-12-13 08:52:35 +08:00
|
|
|
|
private bool _newerVersionAvailable = false;
|
|
|
|
|
private string _latestVersion = null;
|
|
|
|
|
|
2019-11-27 11:33:00 +08:00
|
|
|
|
public About()
|
|
|
|
|
{
|
|
|
|
|
InitializeComponent();
|
2019-11-28 06:09:36 +08:00
|
|
|
|
}
|
|
|
|
|
|
2019-12-13 08:52:35 +08:00
|
|
|
|
public bool NewerVersionAvailable
|
2019-11-28 06:09:36 +08:00
|
|
|
|
{
|
2019-12-13 08:52:35 +08:00
|
|
|
|
get { return _newerVersionAvailable; }
|
|
|
|
|
set { _newerVersionAvailable = value; }
|
2019-11-27 11:33:00 +08:00
|
|
|
|
}
|
|
|
|
|
|
2019-12-13 08:52:35 +08:00
|
|
|
|
public string LatestVersion
|
2019-11-27 11:33:00 +08:00
|
|
|
|
{
|
2019-12-13 08:52:35 +08:00
|
|
|
|
get { return _latestVersion; }
|
|
|
|
|
set { _latestVersion = value; }
|
2019-11-27 11:33:00 +08:00
|
|
|
|
}
|
|
|
|
|
|
2019-12-13 08:52:35 +08:00
|
|
|
|
private void About_Load(object sender, EventArgs e)
|
2019-11-27 11:33:00 +08:00
|
|
|
|
{
|
2019-12-13 08:52:35 +08:00
|
|
|
|
this.Text = Utils.AssemblyProduct;
|
|
|
|
|
this.lblProductName.Text = this.Text;
|
|
|
|
|
|
|
|
|
|
Version installedVersion = new Version(Utils.AssemblyVersion);
|
|
|
|
|
string installedVersionMajorMinorBuild = String.Format("{0}.{1}.{2}", installedVersion.Major, installedVersion.Minor, installedVersion.Build);
|
|
|
|
|
|
|
|
|
|
this.lblProductVersion.Text = String.Format("Installed version {0}", installedVersionMajorMinorBuild);
|
|
|
|
|
if (_newerVersionAvailable)
|
2019-11-27 11:33:00 +08:00
|
|
|
|
{
|
2019-12-13 08:52:35 +08:00
|
|
|
|
linkLatestVersion.Visible = true;
|
|
|
|
|
linkLatestVersion.Text = String.Format("Latest version {0}", _latestVersion);
|
2019-11-27 11:33:00 +08:00
|
|
|
|
}
|
2019-12-13 08:52:35 +08:00
|
|
|
|
this.linkReleaseHistory.LinkVisited = false;
|
2019-11-27 11:33:00 +08:00
|
|
|
|
}
|
|
|
|
|
|
2019-12-13 08:52:35 +08:00
|
|
|
|
private void linkLatestVersion_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
|
2019-11-27 11:33:00 +08:00
|
|
|
|
{
|
2019-12-13 08:52:35 +08:00
|
|
|
|
this.linkLatestVersion.LinkVisited = true;
|
|
|
|
|
System.Diagnostics.Process.Start(Utils.LatestVersionDownloadUrl);
|
2019-11-27 11:33:00 +08:00
|
|
|
|
}
|
|
|
|
|
|
2019-12-13 08:52:35 +08:00
|
|
|
|
private void linkReleaseHistory_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
|
|
|
|
|
{
|
|
|
|
|
this.linkReleaseHistory.LinkVisited = true;
|
|
|
|
|
System.Diagnostics.Process.Start(Utils.ReleaseHistoryUrl);
|
|
|
|
|
}
|
2019-11-28 06:09:36 +08:00
|
|
|
|
|
2019-12-13 08:52:35 +08:00
|
|
|
|
private void linkDocumentation_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
|
|
|
|
|
{
|
|
|
|
|
this.linkDocumentation.LinkVisited = true;
|
|
|
|
|
System.Diagnostics.Process.Start(Utils.DocumentationUrl);
|
|
|
|
|
}
|
2019-11-27 11:33:00 +08:00
|
|
|
|
}
|
|
|
|
|
}
|