public ProxyServerInfo(ProxyMappingInfo pm) { InitializeComponent(); _pm = pm; TxtRemotePort.Text = pm.RemotePort.ToString(); IpRemote.SetIp(pm.RemoteIp); TxtMinLocalPort.Text = pm.LocalMinPort.ToString(); TxtMaxLocalPort.Text = pm.LocalMaxPort.ToString(); IpLocal.SetIp(pm.LocalIp); IpRemote.TextChanged += IpRemote_TextChanged; IpLocal.TextChanged += IpLocal_TextChanged; TxtRemotePort.TextChanged += TxtRemotePort_TextChanged; TxtMinLocalPort.TextChanged += TxtLocalPort_TextChanged; TxtMaxLocalPort.TextChanged += TxtLocalPort_TextChanged; ChkEnabled.Checked = pm.IsEnabled; }
private void IpLocal_TextChanged(object sender, EventArgs e) { _pm.LocalIp = IpLocal.GetIp(); }