|
using System;
using System.Diagnostics;
using System.Text;
using System.Windows.Forms;
using JetBrains.Annotations;
using Kaleida.ServiceMonitor.Model;
using Kaleida.ServiceMonitor.Model.Runtime;
namespace Kaleida.ServiceMonitor.UI
{
public partial class AboutControl : UserControl
{
private string versionCheckSummary;
public AboutControl()
{
InitializeComponent();
UpdateVersionLabel();
lblProcessInfo.Text = string.Format("Current process id: " + Process.GetCurrentProcess().Id);
}
public void PopulateOperationsHelp([NotNull] RuntimeEnvironment runtimeEnvironment)
{
if (runtimeEnvironment == null) throw new ArgumentNullException("runtimeEnvironment");
wbOperationsHelp.Navigate("about:blank");
if (wbOperationsHelp.Document != null)
{
string htmlHelp = ReflectionOperationHtmlHelpBuilder.GetOperationsHtmlHelp(runtimeEnvironment);
wbOperationsHelp.Document.Write(htmlHelp);
}
}
public void SetVersionCheckStatus(string summary, string fullDetails = null)
{
if (fullDetails != null)
{
var tooltip = new ToolTip();
tooltip.SetToolTip(labelVersion, fullDetails);
}
versionCheckSummary = summary;
UpdateVersionLabel();
}
private void UpdateVersionLabel()
{
var summary = new StringBuilder();
summary.AppendFormat("Version {0}", ServiceMon.VersionNumber);
if (versionCheckSummary != null)
{
summary.AppendFormat(" ({0})", versionCheckSummary);
}
labelVersion.Text = summary.ToString();
}
private static void BrowseTo(string url)
{
var sInfo = new ProcessStartInfo(url);
Process.Start(sInfo);
}
private void linkHomepage_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
BrowseTo("https://www.rightcalc.com/blog/servicemon/");
}
private void linkKaleida_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
BrowseTo("http://www.kaleida.co.uk/");
}
private void linkReportIssue_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
BrowseTo("http://servicemon.codeplex.com/WorkItem/Create");
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
Stuart Wheelwright is the Principal Architect and Software Developer at
BlackJet Software Ltd.
He has over 16 years commercial experience producing robust, maintainable, web-based solutions and bespoke systems for Microsoft platforms.
His latest project is
Shopping UK, an elegantly simple shopping list for iPhone.