void OnToolsOptions(object sender, RoutedEventArgs argg) { var d = new FormOptions(this); d.textListeningPort.Text = Eng.LocalPort.ToString(); var proxyEp = UserAppRegistryKey.GetValue("ProxyEndPoint"); if (proxyEp != null) { try { d.editProxy.Text = Convert.ToString(proxyEp); } catch (Exception) { } } var proxyType = UserAppRegistryKey.GetValue("ProxyType"); if (proxyType != null) { try { d.cbProxy.Text = Convert.ToString(proxyType); } catch (Exception) { } } if (Dialog.ShowDialog(d, this)) { UInt16 port = Convert.ToUInt16(d.textListeningPort.Text); Eng.LocalPort = port; Eng.ProxyString = ToProxyString(d.cbProxy.Text, d.editProxy.Text); UserAppRegistryKey.SetValue("LocalPort", port, RegistryValueKind.DWord); UserAppRegistryKey.SetValue("ProxyType", d.cbProxy.Text); UserAppRegistryKey.SetValue("ProxyEndPoint", d.editProxy.Text); } }
void OnToolsOptions(object sender, RoutedEventArgs argg) { var d = new FormOptions(); d.textListeningPort.Text = Eng.LocalPort.ToString(); if (Dialog.ShowDialog(d, this)) { UInt16 port = Convert.ToUInt16(d.textListeningPort.Text); Eng.LocalPort = port; UserAppRegistryKey.SetValue("LocalPort", port, RegistryValueKind.DWord); } }
void OnToolsOptions(object sender, RoutedEventArgs argg) { var d = new FormOptions(this); d.textListeningPort.Text = Eng.LocalPort.ToString(); var proxyEp = UserAppRegistryKey.GetValue("ProxyEndPoint"); if (proxyEp != null) try { d.editProxy.Text = Convert.ToString(proxyEp); } catch (Exception) { } var proxyType = UserAppRegistryKey.GetValue("ProxyType"); if (proxyType != null) try { d.cbProxy.Text = Convert.ToString(proxyType); } catch (Exception) { } if (Dialog.ShowDialog(d, this)) { UInt16 port = Convert.ToUInt16(d.textListeningPort.Text); Eng.LocalPort = port; Eng.ProxyString = ToProxyString(d.cbProxy.Text, d.editProxy.Text); UserAppRegistryKey.SetValue("LocalPort", port, RegistryValueKind.DWord); UserAppRegistryKey.SetValue("ProxyType", d.cbProxy.Text); UserAppRegistryKey.SetValue("ProxyEndPoint", d.editProxy.Text); } }