/
frmSplash.cs
125 lines (102 loc) · 3.83 KB
/
frmSplash.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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Reflection;
namespace TubeGuardian
{
public partial class frmSplash : Form
{
public clsActors _actors = new clsActors("TubeGuardianDeux", "AI39si6KAyk2O5QnDJ7suAVV1ja2903FAAtHK96xEYH7j8oJzl3absfsoKbyRBM4uK80txtxzmMR-zEUPbXG-hu9cferIHyhog");
public frmSplash()
{
InitializeComponent();
}
Timer move_on = new Timer();
private frmSysTray trayMenu;
private void frmSplash_Load(object sender, EventArgs e)
{
move_on.Tick += new EventHandler(move_on_Tick);
move_on.Interval = 1500;
}
void move_on_Tick(object sender, EventArgs e)
{
move_on.Enabled = false;
try
{
Assembly asm = Assembly.GetExecutingAssembly();
System.Net.WebClient client = new System.Net.WebClient();
System.Console.WriteLine(asm.GetName().Version.ToString());
if (client.DownloadString(new Uri("http://www.joshcgoodwin.com/tgv.dat")) != asm.GetName().Version.ToString())
{
if (MessageBox.Show("Your TubeGuardian is out of date! Would you like to see the update page?", "TubeGuardianDeux", MessageBoxButtons.YesNo) == DialogResult.Yes)
System.Diagnostics.Process.Start("http://tg.leagueofreason.co.uk/");
}
}
catch (Exception ex)
{
};
Application.DoEvents();
trayMenu = new frmSysTray(_actors);
trayMenu.Visible = false;
trayMenu.Show();
this.Close();
}
protected override void OnClosing(CancelEventArgs e)
{
FadeEffect.FadeForm(this, 120);
base.OnClosing(e);
}
private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
System.Diagnostics.Process.Start("http://www.youtube.com/user/joshTheGoods");
}
private void linkLabel2_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
System.Diagnostics.Process.Start("https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=7402884");
}
private void frmSplash_Shown(object sender, EventArgs e)
{
move_on.Enabled = true;
}
private void pictureBox1_Click(object sender, EventArgs e)
{
}
}
public class clsActors
{
private clsStatMonger _Collector;
private clsStatMasher _Analyzer;
private clsED _ED;
private clsSettings _Settings;
public clsActors(string ApplicationName, string DevKey)
{
_Settings = new clsSettings();
_Collector = new clsStatMonger(DevKey, ApplicationName, _Settings.Accounts, _Settings);
_Analyzer = new clsStatMasher(_Collector.InitialDataSet, _Collector.HistoricalDataPoints);
_ED = new clsED(_Settings);
}
public clsSettings Settings { get { return _Settings; } }
public clsStatMasher Analyzer { get { return _Analyzer; } }
public clsStatMonger Collector { get { return _Collector; } }
public clsED ED { get { return _ED; } }
}
public static class FadeEffect
{
public static void FadeForm(System.Windows.Forms.Form f, byte NumberOfSteps)
{
float StepVal = (float)(100f / NumberOfSteps);
float fOpacity = 100f;
for (byte b = 0; b < NumberOfSteps; b++)
{
f.Opacity = fOpacity / 100;
f.Refresh();
fOpacity -= StepVal;
}
}
}
}