2019-11-20 11:49:47 +00:00
|
|
|
|
using JCS;
|
|
|
|
|
|
using System;
|
2016-01-07 15:00:49 +00:00
|
|
|
|
using System.Diagnostics;
|
2019-11-20 11:49:47 +00:00
|
|
|
|
using System.Drawing;
|
|
|
|
|
|
using System.Text;
|
2016-01-07 15:00:49 +00:00
|
|
|
|
using System.Windows.Forms;
|
|
|
|
|
|
|
2016-01-09 20:46:25 +00:00
|
|
|
|
namespace Crypto_Notepad
|
2016-01-07 15:00:49 +00:00
|
|
|
|
{
|
|
|
|
|
|
public partial class AboutFrom : Form
|
|
|
|
|
|
{
|
2019-11-20 11:49:47 +00:00
|
|
|
|
private Random rnd = new Random();
|
2016-01-07 15:00:49 +00:00
|
|
|
|
public AboutFrom()
|
|
|
|
|
|
{
|
|
|
|
|
|
InitializeComponent();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2019-11-24 07:30:31 +00:00
|
|
|
|
#region Methods
|
|
|
|
|
|
private void GetDebugInfo()
|
2019-11-20 11:49:47 +00:00
|
|
|
|
{
|
2016-01-07 15:00:49 +00:00
|
|
|
|
Version vrs = new Version(Application.ProductVersion);
|
2019-11-20 11:49:47 +00:00
|
|
|
|
StringBuilder sb = new StringBuilder(string.Empty);
|
2019-11-24 07:33:02 +00:00
|
|
|
|
sb.AppendLine("App version = " + vrs);
|
2019-11-24 20:36:03 +00:00
|
|
|
|
sb.AppendLine(string.Format("OS name = {0}", OSVersionInfo.Name));
|
2019-11-24 07:33:02 +00:00
|
|
|
|
sb.AppendLine(string.Format("OS version = {0}", OSVersionInfo.VersionString));
|
|
|
|
|
|
sb.AppendLine(".Net Framework = " + Methods.GetDotNetVersion());
|
2019-11-20 11:49:47 +00:00
|
|
|
|
Clipboard.SetText(sb.ToString());
|
2019-11-24 20:06:24 +00:00
|
|
|
|
aboutToolTip.AutoPopDelay = 1000;
|
2019-11-24 20:03:20 +00:00
|
|
|
|
aboutToolTip.SetToolTip(appVersionLabel, "Copied");
|
2016-01-07 15:00:49 +00:00
|
|
|
|
}
|
2019-11-20 11:59:38 +00:00
|
|
|
|
#endregion
|
2016-01-07 15:00:49 +00:00
|
|
|
|
|
2019-11-20 11:49:47 +00:00
|
|
|
|
|
2019-11-20 11:59:38 +00:00
|
|
|
|
#region Event Handlers
|
2019-11-20 11:49:47 +00:00
|
|
|
|
private void AboutWindow_Load(object sender, EventArgs e)
|
2016-01-10 12:28:43 +00:00
|
|
|
|
{
|
2019-11-20 11:49:47 +00:00
|
|
|
|
Version vrs = new Version(Application.ProductVersion);
|
|
|
|
|
|
appVersionLabel.Text = string.Format(PublicVar.appName + " {0}.{1}.{2}", vrs.Major, vrs.Minor, vrs.Build);
|
2016-01-10 12:28:43 +00:00
|
|
|
|
}
|
2019-01-07 10:04:49 +00:00
|
|
|
|
|
|
|
|
|
|
protected override bool ProcessDialogKey(Keys keyData)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (ModifierKeys == Keys.None && keyData == Keys.Escape)
|
|
|
|
|
|
{
|
|
|
|
|
|
Close();
|
|
|
|
|
|
return true;
|
|
|
|
|
|
}
|
|
|
|
|
|
return base.ProcessDialogKey(keyData);
|
|
|
|
|
|
}
|
2018-02-17 12:47:21 +00:00
|
|
|
|
|
2019-11-20 11:49:47 +00:00
|
|
|
|
private void RandomColorTimer_Tick(object sender, EventArgs e)
|
2018-02-17 12:47:21 +00:00
|
|
|
|
{
|
2019-11-20 11:49:47 +00:00
|
|
|
|
Color randomColor = Color.FromArgb(rnd.Next(256), rnd.Next(256), rnd.Next(256));
|
|
|
|
|
|
appVersionLabel.ForeColor = randomColor;
|
2018-02-17 12:47:21 +00:00
|
|
|
|
}
|
2019-11-20 17:47:06 +00:00
|
|
|
|
|
|
|
|
|
|
private void AppVersionLabel_MouseDoubleClick(object sender, MouseEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (e.Button == MouseButtons.Left)
|
|
|
|
|
|
{
|
|
|
|
|
|
GetDebugInfo();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2018-02-17 12:47:21 +00:00
|
|
|
|
|
2019-11-20 11:49:47 +00:00
|
|
|
|
private void AppInfoRichTextBox_LinkClicked(object sender, LinkClickedEventArgs e)
|
2016-01-15 16:13:33 +00:00
|
|
|
|
{
|
2018-12-25 15:49:29 +00:00
|
|
|
|
Process.Start(e.LinkText);
|
2016-01-15 16:13:33 +00:00
|
|
|
|
}
|
2019-08-22 19:30:34 +00:00
|
|
|
|
|
2019-11-20 11:59:38 +00:00
|
|
|
|
private void AppVersionLabel_MouseClick(object sender, MouseEventArgs e)
|
2019-08-22 19:30:34 +00:00
|
|
|
|
{
|
2019-11-20 11:49:47 +00:00
|
|
|
|
if (e.Button == MouseButtons.Left)
|
|
|
|
|
|
{
|
|
|
|
|
|
GetDebugInfo();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (e.Button == MouseButtons.Right)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (randomColorTimer.Enabled)
|
|
|
|
|
|
{
|
|
|
|
|
|
randomColorTimer.Stop();
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
randomColorTimer.Start();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2019-08-22 19:30:34 +00:00
|
|
|
|
}
|
2019-11-24 20:03:20 +00:00
|
|
|
|
|
|
|
|
|
|
private void AboutToolTip_Draw(object sender, DrawToolTipEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
e.DrawBackground();
|
|
|
|
|
|
e.DrawBorder();
|
|
|
|
|
|
e.DrawText();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void appVersionLabel_MouseEnter(object sender, EventArgs e)
|
|
|
|
|
|
{
|
2019-11-24 20:06:24 +00:00
|
|
|
|
aboutToolTip.AutoPopDelay = 5000;
|
2019-11-26 14:20:05 +00:00
|
|
|
|
aboutToolTip.SetToolTip(appVersionLabel, "Left click for copy debug info to the clipboard");
|
2019-11-24 20:03:20 +00:00
|
|
|
|
}
|
2019-11-20 11:59:38 +00:00
|
|
|
|
#endregion
|
|
|
|
|
|
|
2018-12-25 15:49:29 +00:00
|
|
|
|
|
2016-01-07 15:00:49 +00:00
|
|
|
|
}
|
|
|
|
|
|
}
|