public override bool Equals(object obj) { myProxy other = obj as myProxy; return((other != null) && (Name == other.Name) && (Ip == other.Ip) && (Port == other.Port)); }
private void RefreshActiveProxy() { myProxy activeProxy = psm.GetAvtiveProxy(); if (activeProxy != null) { txt_avtiveIP.Text = activeProxy.Ip; txt_avtivePort.Text = activeProxy.Port; } else { txt_avtiveIP.Text = ""; txt_avtivePort.Text = ""; } }
private void cmd_saveProxy_Click(object sender, EventArgs e) { var newProxy = new myProxy(txt_proxyName.Text, txt_ip.Text, txt_port.Text); while (list.Contains(newProxy)) { list.Remove(newProxy); } list.Insert(0, newProxy); var bindingList = new BindingList <myProxy>(list); var source = new BindingSource(bindingList, null); dataGridView1.DataSource = source; }