/// <summary> /// /// </summary> /// <param name="cfg"></param> private void SetValue(INetCommuniPortConfig cfg) { if (cfg is RemoteIPAddressConfig) { RemoteIPAddressConfig ipCfg = cfg as RemoteIPAddressConfig; this.txtStationIP.Text = ipCfg.RemoteIPAddress.ToString(); } else if (cfg is RemotePortConfig) { RemotePortConfig rpCfg = cfg as RemotePortConfig; this.numRemotePort.Value = rpCfg.RemotePort; } else if (cfg is LocalPortConfig) { LocalPortConfig lpCfg = cfg as LocalPortConfig; this.numLocalPort.Value = lpCfg.LocalPort; } else if (cfg is RemoteIPAddressAndPortConfig) { RemoteIPAddressAndPortConfig ipPortCfg = cfg as RemoteIPAddressAndPortConfig; this.txtRemoteIPAddress.Text = ipPortCfg.RemoteIPAddress.ToString(); this.numRemotePort2.Value = ipPortCfg.RemotePort; this.cmbConnectionType.SelectedValue = ipPortCfg.ConnectionType; } else { throw new NotSupportedException(cfg.ToString()); } }
/// <summary> /// /// </summary> /// <param name="cfg"></param> private void SetValue(INetCommuniPortConfig cfg) { if (cfg is RemoteIPAddressConfig) { RemoteIPAddressConfig ipCfg = cfg as RemoteIPAddressConfig; this.txtStationIP.Text = ipCfg.RemoteIPAddress.ToString(); } else if (cfg is RemotePortConfig) { RemotePortConfig rpCfg = cfg as RemotePortConfig; this.numRemotePort.Value = rpCfg.RemotePort; } else if (cfg is LocalPortConfig) { LocalPortConfig lpCfg = cfg as LocalPortConfig; this.numLocalPort.Value = lpCfg.LocalPort; } else { throw new NotSupportedException(cfg.ToString()); } }