-
Notifications
You must be signed in to change notification settings - Fork 8
/
About.cs
96 lines (79 loc) · 3.38 KB
/
About.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;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Windows.Forms;
namespace Rappen.XTB.AutoNumManager
{
public partial class About : Form
{
#region Private Fields
private AutoNumMgr autoNumMgr;
#endregion Private Fields
#region Public Constructors
public About(AutoNumMgr autoNumMgr)
{
InitializeComponent();
this.autoNumMgr = autoNumMgr;
PopulateAssemblies();
}
#endregion Public Constructors
#region Private Methods
private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
autoNumMgr.LogUse("About-OpenHomepage");
System.Diagnostics.Process.Start("https://jonasr.app/ANM");
}
private void linkLabel2_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
autoNumMgr.LogUse("About-OpenBlog");
System.Diagnostics.Process.Start("http://jonasr.app");
}
private void linkLabel4_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
autoNumMgr.LogUse("About-OpenTwitter");
System.Diagnostics.Process.Start("https://x.com/rappen");
}
private void PopulateAssemblies()
{
var assemblies = GetReferencedAssemblies();
var items = assemblies.Select(a => GetListItem(a)).ToArray();
listAssemblies.Items.Clear();
listAssemblies.Items.AddRange(items);
}
private ListViewItem GetListItem(AssemblyName a)
{
var item = new ListViewItem(a.Name);
item.SubItems.Add(a.Version.ToString());
return item;
}
private List<AssemblyName> GetReferencedAssemblies()
{
var names = Assembly.GetExecutingAssembly().GetReferencedAssemblies()
.Where(a => !a.Name.Equals("mscorlib") && !a.Name.StartsWith("System") && !a.Name.Contains("CSharp")).ToList();
names.Add(Assembly.GetEntryAssembly().GetName());
names.Add(Assembly.GetExecutingAssembly().GetName());
names = names.OrderBy(a => assemblyPrioritizer(a.Name)).ToList();
return names;
}
private static string assemblyPrioritizer(string assemblyName)
{
return
assemblyName.Equals("XrmToolBox") ? "AAAAAAAAAAAA" :
assemblyName.Contains("XrmToolBox") ? "AAAAAAAAAAAB" :
assemblyName.Equals(Assembly.GetExecutingAssembly().GetName().Name) ? "AAAAAAAAAAAC" :
assemblyName.Contains("Jonas") ? "AAAAAAAAAAAD" :
assemblyName.Contains("Innofactor") ? "AAAAAAAAAAAE" :
assemblyName.Contains("Cinteros") ? "AAAAAAAAAAAF" :
assemblyName;
}
private void linkLabel5_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
MessageBox.Show(@"The evolution of Auto Number Manager is based on feedback issues and anonymous statistics collected about usage.
The statistics are a valuable source of information for continuing the development to make the tool even easier to use and improve the most popular features.
Thank You,
Jonas", "Anonymous statistics", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
#endregion Private Methods
}
}