public DialogResult run(Indie game) { textBox1.Text = game.Name; richTextBox1.Text = game.Description; pictureBox1.ImageLocation = game.Path; pictureBox2.ImageLocation = game.Icon; return this.ShowDialog(); }
public DialogResult run(Indie game) { textBox1.Text = game.Name; richTextBox1.Text = game.Description; pictureBox1.ImageLocation = game.Path; pictureBox2.ImageLocation = game.Icon; return(this.ShowDialog()); }
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(); }
public DialogResult run(Indie _game, Person _user) { game = _game; label1.Text = game.Name; richTextBox1.Text = game.Description; pictureBox1.ImageLocation = game.Path; user = _user; for (int i = 0; i < user.IGlib.Count; i++) { if (user.IGlib[i].Name == game.Name) { label3.Enabled = false; label3.Text = "Play"; } } return(this.ShowDialog()); }
public DialogResult run(Indie _game,Person _user) { game = _game; label1.Text = game.Name; richTextBox1.Text = game.Description; pictureBox1.ImageLocation = game.Path; user = _user; for (int i = 0; i < user.IGlib.Count; i++) { if (user.IGlib[i].Name == game.Name) { label3.Enabled = false; label3.Text = "Play"; } } return this.ShowDialog(); }
/// <summary> /// Run form /// </summary> /// <param name="newGame">New game</param> /// <param name="newUser">New user</param> /// <returns>Dialog Result</returns> public DialogResult Run(Indie newGame, Person newUser) { this.game = newGame; this.label1.Text = this.game.Name; this.richTextBox1.Text = this.game.Description; this.pictureBox1.ImageLocation = this.game.Path; this.user = newUser; for (int i = 0; i < this.user.IndieGlib.Count; i++) { if (this.user.IndieGlib[i].Name == this.game.Name) { this.label3.Enabled = false; this.label3.Text = "Play"; } } return this.ShowDialog(); }
/// <summary> /// Load ShopForm /// </summary> /// <param name="sender"> Event sender</param> /// <param name="e"> Event argument</param> private void ShopForm_Load(object sender, EventArgs e) { this.Size = new System.Drawing.Size((int)SystemInformation.PrimaryMonitorSize.Width, (int)SystemInformation.PrimaryMonitorSize.Height); ////accountLabel.Location = new System.Drawing.Point((int)((SystemInformation.PrimaryMonitorSize.Width-163)/2), (int)(25)); this.timer1.Start(); this.timer2.Start(); this.button1.TabStop = false; this.CancelButton = this.button1; string host = "localhost"; // Имя хоста string database = "steame"; // Имя базы данных string user = "******"; // Имя пользователя string password = "******"; // Пароль пользователя string Connect = "Database=" + database + ";Server=" + host + ";Uid=" + user + ";Pwd=" + password; MySqlConnection mysql_connection = new MySqlConnection(Connect); MySqlCommand mysql_query = mysql_connection.CreateCommand(); mysql_query.CommandText = "SELECT * FROM indie;"; mysql_connection.Open(); MySqlDataReader mysql_result; mysql_result = mysql_query.ExecuteReader(); string prefix = "..\\..\\Indie Games\\"; while (mysql_result.Read()) { Indie insert = new Indie(); insert.Id = Int32.Parse(mysql_result.GetString(0)); insert.Name = mysql_result.GetString(1); insert.Description = mysql_result.GetString(2); insert.Path = prefix + mysql_result.GetString(4); insert.Icon = prefix + mysql_result.GetString(3); this.indies.Add(insert); } mysql_connection.Close(); this.InitializeTabPage3(); }
/// <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(); }
public void indieTestSets() { Indie i = new Indie(); i.Name = "0"; i.Description = "1"; i.Icon = "2"; i.Path = "3"; if (i.Name != "0") { Assert.Fail(); } if (i.Description != "1") { Assert.Fail(); } if (i.Path != "3") { Assert.Fail(); } if (i.Icon != "2") { Assert.Fail(); } }
public void indieTestParametrConstructor() { Indie i = new Indie("1", "2", "3", "4"); if (i.Name != "1") { Assert.Fail(); } if (i.Description != "2") { Assert.Fail(); } if (i.Path != "3") { Assert.Fail(); } if (i.Icon != "4") { Assert.Fail(); } }