Analysis-Services/BismNormalizer/AlmToolkit/About.cs

88 lines
3.1 KiB
C#
Raw Normal View History

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-14 13:15:27 +08:00
this.linkReportIssue.LinkVisited = false;
2019-11-27 11:33:00 +08:00
}
2019-12-13 11:20:36 +08:00
private void linkALMTWebsite_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
this.linkALMTWebsite.LinkVisited = true;
2019-12-14 13:15:27 +08:00
System.Diagnostics.Process.Start("http://alm-toolkit.com/");
2019-12-13 11:20:36 +08:00
}
2020-02-18 23:51:07 +08:00
private void linkHowToUse_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
this.linkHowToUse.LinkVisited = true;
System.Diagnostics.Process.Start("http://alm-toolkit.com/HowToUse");
}
2019-12-13 11:20:36 +08:00
private void linkDocumentation_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
this.linkDocumentation.LinkVisited = true;
2019-12-14 13:15:27 +08:00
System.Diagnostics.Process.Start("https://github.com/microsoft/Analysis-Services/blob/master/BismNormalizer/Model%20Comparison%20and%20Merging%20for%20Analysis%20Services.pdf");
2019-12-13 11:20:36 +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-14 13:15:27 +08:00
private void linkReportIssue_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
2019-12-13 08:52:35 +08:00
{
2019-12-14 13:15:27 +08:00
this.linkReportIssue.LinkVisited = true;
System.Diagnostics.Process.Start("https://github.com/microsoft/Analysis-Services/issues");
2019-12-13 08:52:35 +08:00
}
2019-11-28 06:09:36 +08:00
2019-12-13 11:20:36 +08:00
private void linkTwitter_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
2019-12-13 08:52:35 +08:00
{
2019-12-13 11:20:36 +08:00
this.linkTwitter.LinkVisited = true;
System.Diagnostics.Process.Start("https://twitter.com/_christianWade");
2019-12-13 08:52:35 +08:00
}
2019-11-27 11:33:00 +08:00
}
}