private void lblACNom1_Click(object sender, EventArgs e) { List <String> Item2 = new List <String>(); List <String> ListeProjet = new List <String>(); ListeProjet = Fonction.LectureProjet(); Label lbl = sender as Label; string dt = DateTime.Today.ToShortDateString(); foreach (var item in ListeProjet) { // string[] nomProjet = item.Split(new[] { " /// " }, StringSplitOptions.None); string[] result = Regex.Split(item, @"\-\-\-"); Item2.Add(result[0]); } if (lbl.Text == Item2[0]) { pictureBox1.Visible = false; Fonction.ecrireFichier("", "", "", "", "", "", lbl.Text, dt); FormsCompetence.FormProjetCalculatrice FPC = new FormsCompetence.FormProjetCalculatrice(); FPC.MdiParent = this; FPC.Show(); } if (lbl.Text == Item2[7]) { Fonction.ecrireFichier("", "", "", "", "", "", lbl.Text, dt); DialogResult DR = MessageBox.Show(LangueElement[175] + "\n" + LangueElement[176], LangueElement[177], MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (DR == DialogResult.Yes) { System.Diagnostics.Process p = new System.Diagnostics.Process(); p.StartInfo.FileName = "http://dimitryrobin.fr/Portfolio/AddFindPlayer.php"; p.Start(); } } if (lbl.Text == Item2[1]) { pictureBox1.Visible = false; Fonction.ecrireFichier("", "", "", "", "", "", lbl.Text, dt); FormsCompetence.FormProjetBarreProgCirculaire FPC = new FormsCompetence.FormProjetBarreProgCirculaire(); FPC.MdiParent = this; FPC.Show(); } if (lbl.Text == Item2[2]) { pictureBox1.Visible = false; Fonction.ecrireFichier("", "", "", "", "", "", lbl.Text, dt); FormsCompetence.FormProjetBoutonAnime FPC = new FormsCompetence.FormProjetBoutonAnime("index"); FPC.MdiParent = this; FPC.Show(); } if (lbl.Text == Item2[3]) { pictureBox1.Visible = false; Fonction.ecrireFichier("", "", "", "", "", "", lbl.Text, dt); FormsCompetence.FormProjetCodeSourceSiteWeb FPC = new FormsCompetence.FormProjetCodeSourceSiteWeb("index"); FPC.MdiParent = this; FPC.Show(); } if (lbl.Text == Item2[4]) { pictureBox1.Visible = false; Fonction.ecrireFichier("", "", "", "", "", "", lbl.Text, dt); FormsCompetence.FormProjetFormulaireContactPersonnalise FPC = new FormsCompetence.FormProjetFormulaireContactPersonnalise(); FPC.MdiParent = this; FPC.Show(); } if (lbl.Text == Item2[5]) { pictureBox1.Visible = false; Fonction.ecrireFichier("", "", "", "", "", "", lbl.Text, dt); FormsCompetence.FormProjetImageFlottante FPC = new FormsCompetence.FormProjetImageFlottante(); FPC.MdiParent = this; FPC.Show(); } if (lbl.Text == Item2[6]) { pictureBox1.Visible = false; Fonction.ecrireFichier("", "", "", "", "", "", lbl.Text, dt); FormsCompetence.FormProjetInfoBulle FPC = new FormsCompetence.FormProjetInfoBulle(); FPC.MdiParent = this; FPC.Show(); } if (lbl.Text == Item2[8]) { pictureBox1.Visible = false; Fonction.ecrireFichier("", "", "", "", "", "", lbl.Text, dt); FormsCompetence.FormProjetMorpion FPC = new FormsCompetence.FormProjetMorpion("index"); FPC.MdiParent = this; FPC.Show(); } if (lbl.Text == Item2[9]) { Fonction.ecrireFichier("", "", "", "", "", "", lbl.Text, dt); recommence: string value = "Pseudonyme"; bool check = false; if (Fonction.InputBoxLogin("Pendu", LangueElement[172], ref value, ref check) == DialogResult.OK) { if (check == false) { if (value != "Pseudonyme" && value != "" && value != " " && value != " " && value != " " && value != " " && value != " ") { pictureBox1.Visible = false; nouvJoueur = new Joueur(value); lesJoueurs.Add(nouvJoueur); nouvJoueur.ModifNbPartie(); nouvJoueur.AfficherJoueur(); FormsCompetence.FormProjetPendu FPC = new FormsCompetence.FormProjetPendu(value, nouvJoueur, lesJoueurs, "index"); FPC.MdiParent = this; FPC.Show(); } else { MessageBox.Show(LangueElement[174], LangueElement[173], MessageBoxButtons.OK, MessageBoxIcon.Warning); goto recommence; } } else { pictureBox1.Visible = false; nouvJoueur = new Joueur("Guest"); lesJoueurs.Add(nouvJoueur); nouvJoueur.ModifNbPartie(); nouvJoueur.AfficherJoueur(); FormsCompetence.FormProjetPendu FPC = new FormsCompetence.FormProjetPendu("Guest", nouvJoueur, lesJoueurs, "index"); FPC.MdiParent = this; FPC.Show(); } } } if (lbl.Text == Item2[10]) { pictureBox1.Visible = false; Fonction.ecrireFichier("", "", "", "", "", "", lbl.Text, dt); FormsCompetence.FormProjetSnake FPC = new FormsCompetence.FormProjetSnake(); FPC.MdiParent = this; FPC.Show(); } }
protected void LB_Click(object sender, EventArgs e) { Label lbl = sender as Label; List <String> Item2 = new List <String>(); string dt = DateTime.Today.ToShortDateString(); if (lbl.Text == Destination[0].ToString()) { Fonction.ecrireFichier("", "", "", "", "", "", lbl.Text, dt); FormIndex form = (FormIndex)this.MdiParent; FormsCompetence.FormProjetCalculatrice FPC = new FormsCompetence.FormProjetCalculatrice(); FPC.MdiParent = form; FPC.Show(); } if (lbl.Text == Destination[1].ToString()) { Fonction.ecrireFichier("", "", "", "", "", "", lbl.Text, dt); FormIndex form = (FormIndex)this.MdiParent; FormsCompetence.FormProjetBarreProgCirculaire FPC = new FormsCompetence.FormProjetBarreProgCirculaire(); FPC.MdiParent = form; FPC.Show(); } if (lbl.Text == Destination[2].ToString()) { Fonction.ecrireFichier("", "", "", "", "", "", lbl.Text, dt); FormIndex form = (FormIndex)this.MdiParent; FormsCompetence.FormProjetBoutonAnime FPC = new FormsCompetence.FormProjetBoutonAnime("arborescence"); FPC.MdiParent = form; FPC.Show(); } if (lbl.Text == Destination[3].ToString()) { Fonction.ecrireFichier("", "", "", "", "", "", lbl.Text, dt); FormIndex form = (FormIndex)this.MdiParent; FormsCompetence.FormProjetCodeSourceSiteWeb FPC = new FormsCompetence.FormProjetCodeSourceSiteWeb("arborescence"); FPC.MdiParent = form; FPC.Show(); } if (lbl.Text == Destination[4].ToString()) { Fonction.ecrireFichier("", "", "", "", "", "", lbl.Text, dt); FormIndex form = (FormIndex)this.MdiParent; FormsCompetence.FormProjetFormulaireContactPersonnalise FPC = new FormsCompetence.FormProjetFormulaireContactPersonnalise(); FPC.MdiParent = form; FPC.Show(); } if (lbl.Text == Destination[5].ToString()) { Fonction.ecrireFichier("", "", "", "", "", "", lbl.Text, dt); FormIndex form = (FormIndex)this.MdiParent; FormsCompetence.FormProjetImageFlottante FPC = new FormsCompetence.FormProjetImageFlottante(); FPC.MdiParent = form; FPC.Show(); } if (lbl.Text == Destination[6].ToString()) { Fonction.ecrireFichier("", "", "", "", "", "", lbl.Text, dt); FormIndex form = (FormIndex)this.MdiParent; FormsCompetence.FormProjetInfoBulle FPC = new FormsCompetence.FormProjetInfoBulle(); FPC.MdiParent = form; FPC.Show(); } if (lbl.Text == Destination[7].ToString()) { Fonction.ecrireFichier("", "", "", "", "", "", lbl.Text, dt); DialogResult DR = MessageBox.Show(LangueElement[175] + "\n" + LangueElement[176], LangueElement[177], MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (DR == DialogResult.Yes) { System.Diagnostics.Process p = new System.Diagnostics.Process(); p.StartInfo.FileName = "http://dimitryrobin.fr/Portfolio/AddFindPlayer.php"; p.Start(); } } if (lbl.Text == Destination[8].ToString()) { Fonction.ecrireFichier("", "", "", "", "", "", lbl.Text, dt); FormsCompetence.FormProjetMorpion FPC = new FormsCompetence.FormProjetMorpion("arborescence"); FormIndex form = (FormIndex)this.MdiParent; FPC.MdiParent = form; FPC.Show(); } if (lbl.Text == Destination[9].ToString()) { Fonction.ecrireFichier("", "", "", "", "", "", lbl.Text, dt); recommence: string value = "Pseudonyme"; bool check = false; if (Fonction.InputBoxLogin("Pendu", LangueElement[172], ref value, ref check) == DialogResult.OK) { if (check == false) { if (value != "Pseudonyme" && value != "" && value != " " && value != " " && value != " " && value != " " && value != " ") { nouvJoueur = new Joueur(value); lesJoueurs.Add(nouvJoueur); nouvJoueur.ModifNbPartie(); nouvJoueur.AfficherJoueur(); FormIndex form = (FormIndex)this.MdiParent; FormsCompetence.FormProjetPendu FPC = new FormsCompetence.FormProjetPendu(value, nouvJoueur, lesJoueurs, "arborescence"); FPC.MdiParent = form; FPC.Show(); } else { MessageBox.Show(LangueElement[174], LangueElement[173], MessageBoxButtons.OK, MessageBoxIcon.Warning); goto recommence; } } else { nouvJoueur = new Joueur("Guest"); lesJoueurs.Add(nouvJoueur); nouvJoueur.ModifNbPartie(); nouvJoueur.AfficherJoueur(); FormIndex form = (FormIndex)this.MdiParent; FormsCompetence.FormProjetPendu FPC = new FormsCompetence.FormProjetPendu("Guest", nouvJoueur, lesJoueurs, "arborescence"); FPC.MdiParent = form; FPC.Show(); } } } if (lbl.Text == Destination[10].ToString()) { Fonction.ecrireFichier("", "", "", "", "", "", lbl.Text, dt); FormIndex form = (FormIndex)this.MdiParent; FormsCompetence.FormProjetSnake FPC = new FormsCompetence.FormProjetSnake(); FPC.MdiParent = form; FPC.Show(); } }
private void ecrireFichier() { if (cbBoiteMessagesOui.Checked == true) { BM = true; } else { BM = false; } if (cbInfoDefilantesOui.Checked == true) { ID = true; } else { ID = false; } if (cbTutorielOui.Checked == true) { Tuto = true; } else { Tuto = false; } if (combobLangue.Text == "Francais" || combobLangue.Text == "French") { langueApres = "Francais"; } else if (combobLangue.Text == "Anglais" || combobLangue.Text == "English") { langueApres = "Anglais"; } string[] lines = Fonction.lireFichier(); Fonction.ecrireFichier(opa.ToString(), BM.ToString(), lblPolice.Text, ID.ToString(), langueApres, Tuto.ToString(), "", ""); if (lines[0].ToString() != opa.ToString() || lines[1].ToString() != BM.ToString() || lines[2].ToString() != lblPolice.Text || lines[3].ToString() != ID.ToString() || lines[4].ToString() != langueApres || lines[5].ToString() != Tuto.ToString()) { DialogResult DR = MessageBox.Show(LangueElement[124], LangueElement[125], MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (DR == DialogResult.Yes) { if (lines[4].ToString() != langueApres) { // Changement de langue --> On réinitialise les vues récemments // On récupère tout StreamReader reader = File.OpenText(@"C:\SkillProject\Preferences_SkillProject.txt"); string ligne; List <string> listeElement = new List <string>(); while (!reader.EndOfStream) { ligne = reader.ReadLine(); listeElement.Add(ligne); } reader.Close(); //// Debut MAJ \\\\ listeElement[6] = "Aucun"; listeElement[7] = "jj/mm/aaaa"; listeElement[8] = "Aucun"; listeElement[9] = "jj/mm/aaaa"; listeElement[10] = "Aucun"; listeElement[11] = "jj/mm/aaaa"; //// Fin MAJ \\\\ // on renvoie tout StreamWriter writer = new StreamWriter(@"C:\SkillProject\Preferences_SkillProject.txt"); foreach (var item in listeElement) { writer.WriteLine(item); } writer.Close(); } Application.Restart(); } } }