-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSplashScreenForm.cs
96 lines (80 loc) · 2.25 KB
/
SplashScreenForm.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
using System.Diagnostics;
using Krypton.Toolkit;
namespace Planetoid_DB
{
/// <summary>
///
/// </summary>
[DebuggerDisplay(value: "{" + nameof(GetDebuggerDisplay) + "(),nq}")]
public partial class SplashScreenForm : KryptonForm
{
#region local methods
/// <summary>
///
/// </summary>
/// <returns></returns>
private string GetDebuggerDisplay() => ToString();
/// <summary>
///
/// </summary>
/// <param name="text"></param>
private void CopyToClipboard(string text)
{
Clipboard.SetText(text: text);
MessageBox.Show(text: I10nStrings.CopiedToClipboard, caption: I10nStrings.InformationCaption, buttons: MessageBoxButtons.OK, icon: MessageBoxIcon.Information);
}
/// <summary>
///
/// </summary>
/// <param name="value"></param>
public void SetProgressbar(int value) => progressBarSplash.Value = value;
#endregion
#region Constructor
/// <summary>
///
/// </summary>
public SplashScreenForm() => InitializeComponent();
#endregion
#region Form* event handlers
/// <summary>
///
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void SplashScreenForm_Load(object sender, EventArgs e)
{
labelDataLoading.Text = I10nStrings.DataLoading;
labelTitle.Text = AssemblyInfo.AssemblyProduct;
labelVersion.Text = string.Format(format: I10nStrings.VersionTemplate, arg0: AssemblyInfo.AssemblyVersion);
}
/// <summary>
///
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void SplashScreenForm_FormClosed(object sender, FormClosedEventArgs e) => Dispose();
#endregion
#region DoubleClick event handlers
/// <summary>
///
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void CopyToClipboard_DoubleClick(object sender, EventArgs e)
{
switch (sender)
{
case Label label:
CopyToClipboard(text: label.Text);
break;
case KryptonLabel kryptonLabel:
CopyToClipboard(text: kryptonLabel.Text);
break;
case ToolStripLabel labelToolStripCombo:
CopyToClipboard(text: labelToolStripCombo.Text);
break;
}
}
#endregion
}
}