internal void removeMdiChild(String username, exListBoxItem elbi) { vClient toRemove = mdiChilds.FirstOrDefault <vClient>(u => u._username == username); try { exListBox1.Items.Remove(elbi); } catch (Exception e) { MessageBox.Show("Error on remove Child. Please contact me with the Message blow!\n\n" + e.Message); } mdiChilds.Remove(toRemove); }
internal void removeMdiChild(string username, exListBoxItem elbi) { vClient item = VoliBot.mdiChilds.FirstOrDefault((vClient u) => u._username == username); try { this.exListBox1.Items.Remove(elbi); } catch (Exception ex) { MessageBox.Show("Error on remove Child. Please contact me with the Message blow!\n\n" + ex.Message); } VoliBot.mdiChilds.Remove(item); }
public void addMdiChild(String username, String password, String region, bool autoConnect = false) { if(mdiChilds.Count<vClient>(u => u._username == username) > 0) { MessageBox.Show("This Client already exist."); return; } Image summonerIcon = Basic.returnIcon(0); vClient t = new vClient(username, password, region, this, autoConnect); exListBoxItem eLBI = new exListBoxItem(t._username, t._username, "Status: Waiting...", "", summonerIcon); t.addListBoxItem(eLBI); exListBox1.Items.Add(eLBI); mdiChilds.Add(t); t.MdiParent = this; t.Show(); id++; }
public void addMdiChild(String username, String password, String region, bool autoConnect = false) { if (mdiChilds.Count <vClient>(u => u._username == username) > 0) { MessageBox.Show("This Client already exist."); return; } Image summonerIcon = Basic.returnIcon(0); vClient t = new vClient(username, password, region, this, autoConnect); exListBoxItem eLBI = new exListBoxItem(t._username, t._username, "Status: Waiting...", "", summonerIcon); t.addListBoxItem(eLBI); exListBox1.Items.Add(eLBI); mdiChilds.Add(t); t.MdiParent = this; t.Show(); id++; }
public void addMdiChild(string username, string password, string region, bool autoConnect = false) { if (VoliBot.mdiChilds.Count((vClient u) => u._username == username) > 0) { MessageBox.Show("This Client already exist."); return; } Image image = Basic.returnIcon(0); vClient vClient = new vClient(username, password, region, this, autoConnect); exListBoxItem exListBoxItem = new exListBoxItem(vClient._username, vClient._username, "Status: Waiting...", "", image); vClient.addListBoxItem(exListBoxItem); this.exListBox1.Items.Add(exListBoxItem); VoliBot.mdiChilds.Add(vClient); vClient.MdiParent = this; vClient.Show(); this.id++; }
private void exListBox1_MouseDoubleClick(object sender, MouseEventArgs e) { try { int index = exListBox1.IndexFromPoint(e.Location); if (index != ListBox.NoMatches) { exListBoxItem ix = (exListBoxItem)exListBox1.Items[index]; vClient client = mdiChilds.FirstOrDefault <vClient>(u => u._username == ix.Id); if (client.WindowState == FormWindowState.Maximized) { client.WindowState = FormWindowState.Normal; } else { client.WindowState = FormWindowState.Maximized; } } } catch (Exception) { } }
private void exListBox1_MouseDoubleClick(object sender, MouseEventArgs e) { try { int num = this.exListBox1.IndexFromPoint(e.Location); if (num != -1) { exListBoxItem ix = (exListBoxItem)this.exListBox1.Items[num]; vClient vClient = VoliBot.mdiChilds.FirstOrDefault((vClient u) => u._username == ix.Id); if (vClient.WindowState == FormWindowState.Maximized) { vClient.WindowState = FormWindowState.Normal; } else { vClient.WindowState = FormWindowState.Maximized; } } } catch (Exception) { } }