コード例 #1
0
        private void MenuAddSrv_Click(object sender, RoutedEventArgs e)
        {
            var ConnParamsWnd = new ConnParams(fCredsRequired)
            {
                Owner = this
            };

            if (fCredsRequired)
            {
            }
            if ((bool)ConnParamsWnd.ShowDialog())
            {
                var Params = new KlAkParams()
                {
                    { "Address", ConnParamsWnd.tbAddress.Text + ":" + ConnParamsWnd.tbPort.Text }
                };
                if (ConnParamsWnd.cbUseSSL.IsChecked.HasValue)
                {
                    Params.Add("UseSSL", ConnParamsWnd.cbUseSSL.IsChecked);
                }
                if (ConnParamsWnd.cbCompressTraffic.IsChecked.HasValue)
                {
                    Params.Add("CompressTraffic", ConnParamsWnd.cbUseSSL.IsChecked);
                }
                if ((bool)ConnParamsWnd.cbIsAuthenticating.IsChecked)
                {
                    Params.Add("User", ConnParamsWnd.tbUser.Text);
                    if (ConnParamsWnd.tbDomain.Text != "")
                    {
                        Params.Add("Domain", ConnParamsWnd.tbDomain.Text);
                    }
                    Params.Add("Password", ConnParamsWnd.tbPassword.Password);
                }
                if ((bool)ConnParamsWnd.cbIsUsingProxy.IsChecked)
                {
                    Params.Add("ProxyAddress", ConnParamsWnd.tbProxyAddress.Text + ":" + ConnParamsWnd.tbProxyPort.Text);
                    if (ConnParamsWnd.tbProxyUser.Text != "")
                    {
                        Params.Add("ProxyLogin", ConnParamsWnd.tbProxyUser.Text);
                        Params.Add("ProxyPassword", ConnParamsWnd.tbProxyPassword.Password);
                    }
                }
                if (ConnParamsWnd.cbThroughGw.IsChecked.HasValue)
                {
                    Params.Add("ThroughGw", ConnParamsWnd.cbThroughGw.IsChecked);
                }

                var Root = new TVISrvRoot()
                {
                    ConnectionParameters = Params
                };
                SrvTree.Items.Add(Root);
            }
        }
コード例 #2
0
 void ViewSrvInfo(TVISrvRoot Item)
 {
     SrvInfo.Items.Clear();
     SrvInfo.Items.Add(Item.ViewPxyProps());
 }