private void AdminClick(object sender) { Label Caller = sender as Label; IndieGame igame = new IndieGame(); this.Hide(); if (Caller.Text == "New Game") { if (igame.run() == DialogResult.OK) { for (int i = 0; i < newgameList.Count; i++) { if (Caller.Name == icons[i].Name) { icons[i].Image = igame.pictureBox2.Image; } } Caller.Text = igame.textBox1.Text; Indie gamie = new Indie(igame.textBox1.Text, igame.richTextBox1.Text, igame.pictureBox1.ImageLocation, igame.pictureBox2.ImageLocation); indies.Add(gamie); } } else { for (int i = 0; i < indies.Count; i++) { if (Caller.Text == indies[i].Name) { if (igame.run(indies[i]) == DialogResult.OK) { for (int j = 0; j < newgameList.Count; j++) { if (Caller.Name == icons[j].Name) { icons[j].Image = igame.pictureBox2.Image; } } Caller.Text = igame.textBox1.Text; Indie gamie = new Indie(igame.textBox1.Text, igame.richTextBox1.Text, igame.pictureBox1.ImageLocation, igame.pictureBox2.ImageLocation); indies[i] = gamie; } } } } this.Show(); }
/// <summary> /// Admin click /// </summary> /// <param name="sender"> Event sender.</param> private void AdminClick(object sender) { Label caller = sender as Label; IndieGame igame = new IndieGame(); if (caller.Text == "New Game") { this.Hide(); if (igame.Run() == DialogResult.OK) { for (int i = 0; i < this.newgameList.Count; i++) { if (caller.Name == this.icons[i].Name) { this.icons[i].Image = igame.pictureBox2.Image; } } caller.Text = igame.textBox1.Text; Indie gamie = new Indie(igame.textBox1.Text, igame.richTextBox1.Text, igame.pictureBox1.ImageLocation, igame.pictureBox2.ImageLocation); this.indies.Add(gamie); Database.Indie.create(gamie); } this.Show(); } /*else { for (int i = 0; i < this.indies.Count; i++) { if (caller.Text == this.indies[i].Name) { if (igame.Run(this.indies[i]) == DialogResult.OK) { for (int j = 0; j < this.newgameList.Count; j++) { if (caller.Name == this.icons[j].Name) { this.icons[j].Image = igame.pictureBox2.Image; } } caller.Text = igame.textBox1.Text; Indie gamie = new Indie(igame.textBox1.Text, igame.richTextBox1.Text, igame.pictureBox1.ImageLocation, igame.pictureBox2.ImageLocation); string s = @"http://al-capone.appspot.com/rateeverything?"; s += @"email="; s += this.user.Login; s += @"&pass="******"&old="; s += this.indies[i].Name; this.indies[i] = gamie; s += @"&igame="; s += this.indies[i].Name; s += @"&description="; s += this.indies[i].Description; s += @"&icon="; s += this.indies[i].Icon; s += @"&avatar="; s += this.indies[i].Path; s += @"&createIGame="; s += 1; System.Net.WebRequest reqGET = System.Net.WebRequest.Create(s); System.Net.WebResponse resp = reqGET.GetResponse(); System.IO.Stream stream = resp.GetResponseStream(); System.IO.StreamReader sr = new System.IO.StreamReader(stream); s = sr.ReadToEnd(); } } } }*/ ////this.Show(); }