Beispiel #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);
            }
        }
Beispiel #2
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.ConnParamsWnd = ((KlAkEnum.ConnParams)(target));
                return;

            case 2:
                this.cbIsAuthenticating = ((System.Windows.Controls.CheckBox)(target));

            #line 27 "..\..\ConnParams.xaml"
                this.cbIsAuthenticating.Checked += new System.Windows.RoutedEventHandler(this.cbIsAuthenticating_Checked);

            #line default
            #line hidden

            #line 27 "..\..\ConnParams.xaml"
                this.cbIsAuthenticating.Unchecked += new System.Windows.RoutedEventHandler(this.cbIsAuthenticating_Checked);

            #line default
            #line hidden
                return;

            case 3:
                this.tbPassword = ((System.Windows.Controls.PasswordBox)(target));
                return;

            case 4:
                this.tbDomain = ((System.Windows.Controls.TextBox)(target));
                return;

            case 5:
                this.tbUser = ((System.Windows.Controls.TextBox)(target));
                return;

            case 6:
                this.cbCompressTraffic = ((System.Windows.Controls.CheckBox)(target));
                return;

            case 7:
                this.cbUseSSL = ((System.Windows.Controls.CheckBox)(target));

            #line 51 "..\..\ConnParams.xaml"
                this.cbUseSSL.Indeterminate += new System.Windows.RoutedEventHandler(this.cbIsAuthenticating_Checked);

            #line default
            #line hidden

            #line 51 "..\..\ConnParams.xaml"
                this.cbUseSSL.Checked += new System.Windows.RoutedEventHandler(this.cbIsAuthenticating_Checked);

            #line default
            #line hidden

            #line 51 "..\..\ConnParams.xaml"
                this.cbUseSSL.Unchecked += new System.Windows.RoutedEventHandler(this.cbIsAuthenticating_Checked);

            #line default
            #line hidden
                return;

            case 8:
                this.cbThroughGw = ((System.Windows.Controls.CheckBox)(target));
                return;

            case 9:
                this.tbAddress = ((System.Windows.Controls.TextBox)(target));
                return;

            case 10:
                this.tbPort = ((System.Windows.Controls.TextBox)(target));
                return;

            case 11:
                this.cbIsUsingProxy = ((System.Windows.Controls.CheckBox)(target));

            #line 68 "..\..\ConnParams.xaml"
                this.cbIsUsingProxy.Checked += new System.Windows.RoutedEventHandler(this.cbIsUsingProxy_Checked);

            #line default
            #line hidden
                return;

            case 12:
                this.tbProxyAddress = ((System.Windows.Controls.TextBox)(target));
                return;

            case 13:
                this.tbProxyPort = ((System.Windows.Controls.TextBox)(target));
                return;

            case 14:
                this.tbProxyUser = ((System.Windows.Controls.TextBox)(target));
                return;

            case 15:
                this.tbProxyPassword = ((System.Windows.Controls.PasswordBox)(target));
                return;

            case 16:

            #line 83 "..\..\ConnParams.xaml"
                ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.Button_Click);

            #line default
            #line hidden
                return;
            }
            this._contentLoaded = true;
        }