-
Notifications
You must be signed in to change notification settings - Fork 0
/
Intro.cs
177 lines (141 loc) · 6.2 KB
/
Intro.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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Xml;
namespace Start
{
public partial class Introduction : Form
{
public Introduction()
{
InitializeComponent();
}
AxWMPLib.AxWindowsMediaPlayer mediaplayer = new AxWMPLib.AxWindowsMediaPlayer();
DataRow[] dr;
enum lecons
{
Conjugaison1, Conjugaison2, Grammaire1, Grammaire2, Orthographe, Nombres, AdditionEtSousrtaction, SuitesDenombres, Moitieetdouble, MultiDivision, Fractions, CroissantEtDecroissant, Priorite, Perimetre, FormesGeometriques, Clock, sens, livingorno, planetes
}XmlDocument prof = new XmlDocument();int i = 0;
private void Form1_Load(object sender, EventArgs e)
{
CryptageEtHachage.CombineUsersElements(CryptageEtHachage.HashPasswordsAndScores(Variables.UserNom),CryptageEtHachage.HashPasswordsAndScores( Variables.UserPass), Application.StartupPath + "\\users.xml");
// Audio manzu3 hek wahdu
prof.Load(Application.StartupPath + "\\Prof.xml");
if (Variables.ExisteMessage(Variables.UserNom)) pictureBox2.Image = Properties.Resources.newMsg;
for (lecons lcs = lecons.Conjugaison1; lcs < lecons.Clock; lcs++)
{
prof.Load(Application.StartupPath + "\\Prof.xml");
if ((int)lcs < 5) { if (Variables.exSup[i] != prof.SelectSingleNode("Prof/Francais/" + lcs + " / Questions").InnerText.Split(',').Length.ToString()) { Suppex.Image = Properties.Resources.newASsignment; break; }; i++; }
else if ((int)lcs < 16){ if (Variables.exSup[i] != prof.SelectSingleNode("Prof/Maths/" + lcs + "/Questions").InnerText.Split(',').Length.ToString()) { Suppex.Image = Properties.Resources.newASsignment; break; }; i++; }
else {if (Variables.exSup[i] != prof.SelectSingleNode("Prof/Sciences/" + lcs + "/Questions").InnerText.Split(',').Length.ToString()) { Suppex.Image = Properties.Resources.newASsignment; break; }; i++; }
}
dr = Variables.XmlReader(Application.StartupPath + "\\users.xml");
Variables.exSup = dr[0]["exSupp"].ToString().Split(',');
if ((string)dr[0]["Type"] == "Prof")
{
Suppex.Visible = false;
addFile.Visible = true;
}
else
{
addFile.Visible = false;
Suppex.Visible = true;
}
mediaplayer.CreateControl();
mediaplayer.URL = Application.StartupPath + "\\Sounds\\Intro0.m4a";
mediaplayer.Ctlcontrols.play();
}
private void btnOff_Click(object sender, EventArgs e)
{
mediaplayer.URL = Application.StartupPath+ @"Sounds/Intro0.m4a";
mediaplayer.Ctlcontrols.play();
btnON.BringToFront();
}
private void btnON_Click(object sender, EventArgs e)
{
mediaplayer.URL = Application.StartupPath + @"Sounds/Intro0.m4a";
mediaplayer.Ctlcontrols.pause();
btnOff.BringToFront();
}
private void btnExit_Click(object sender, EventArgs e)
{
CryptageEtHachage.HashXmlUsers(Variables.UserNom, Variables.UserPass, Application.StartupPath + "\\users.xml");
Application.Exit();
}
private void MathsOpen_Click(object sender, EventArgs e)
{
Variables.MatiereNomPublic = "MT";
Variables.counter = 0;
this.Hide();
Variables.matiere = new MatiereStart();
Variables.matiere.userphoto.Image = Variables.B;
Variables.matiere.username.Text = Variables.UserNom;
Variables.matiere.Show();
this.ShowInTaskbar = false;
}
private void francaisOpen_Click(object sender, EventArgs e)
{
Variables.MatiereNomPublic = "FR";
this.Hide();
Variables.counter = 0;
Variables.matiere = new MatiereStart();
Variables.matiere.userphoto.Image = Variables.B;
Variables.matiere.username.Text = Variables.UserNom;
Variables.matiere.Show();
this.ShowInTaskbar = false;
}
private void ScienceOpen_Click(object sender, EventArgs e)
{
this.Hide();
Variables.science = new ScienceStart();
Variables.science.userphoto.Image = Variables.B;
Variables.science.username.Text = Variables.UserNom;
Variables.science.Show();
this.ShowInTaskbar = false;
}
private void JeuxOpen_Click(object sender, EventArgs e)
{
this.Hide();
Variables.Jeux = new Jeux();
Variables.Jeux.userphoto.Image = Variables.B;
Variables.Jeux.username.Text = Variables.UserNom;
Variables.Jeux.Show();
this.ShowInTaskbar = false;
}
private void pictureBox1_Click(object sender, EventArgs e)
{
CryptageEtHachage.HashXmlUsers(Variables.UserNom, Variables.UserPass, Application.StartupPath + "\\users.xml");
Variables.formLogin = new Page_entrée();
Variables.formLogin.Show();
this.Close();
Variables.formLogin.ShowInTaskbar = true;
}
private void pictureBox3_Click(object sender, EventArgs e)
{
this.Hide();
exSupp exSupp = new exSupp();
exSupp.Show();
}
private void addFile_Click(object sender, EventArgs e)
{
this.Hide();
addEx add = new addEx();
add.Show();
}
private void Introduction_FormClosed(object sender, FormClosedEventArgs e)
{
// CryptageEtHachage.HashXmlUsers(Variables.UserNom, Variables.UserPass, Application.StartupPath + "\\users.xml");
}
private void pictureBox2_Click(object sender, EventArgs e)
{
Variables.m = new Message();
Variables.m.Show();
}
}
}