Inheritance: System.Windows.Window
        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);
            }
        }
Exemple #2
0
 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);
     }
 }
Exemple #3
0
        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);
            }
        }