Esempio n. 1
0
        private void Next_Click(object sender, RoutedEventArgs e)
        {
            base.Visibility        = Visibility.Collapsed;
            this.tbServerName.Text = AGSConnection.FixName(this.tbServerName.Text);
            AGSConnection aGSConnection = null;

            try
            {
                aGSConnection = new AGSConnection(this.tbServerName.Text, this.tbServerURL.Text);
            }
            catch
            {
                ErrorReport.ShowErrorMessage(AfaStrings.ErrorConnectingToServer);
                base.Visibility = Visibility.Visible;
                this.Succeeded  = false;
            }
            if (aGSConnection != null && !aGSConnection.ConnectionFailed)
            {
                aGSConnection.UserName = this.tbUserName.Text;
                aGSConnection.Password = this.tbPassword.Password;
                Mouse.OverrideCursor   = Cursors.Wait;
                if (!aGSConnection.LoadConnectionProperties())
                {
                    Mouse.OverrideCursor = null;
                    ErrorReport.ShowErrorMessage(aGSConnection.ErrorMessage);
                    base.Visibility = Visibility.Visible;
                    this.Succeeded  = false;
                    return;
                }
                Mouse.OverrideCursor = null;
                base.Close();
                Mouse.OverrideCursor = Cursors.Wait;
                if (!aGSConnection.LoadChildren())
                {
                    Mouse.OverrideCursor = null;
                    string text = aGSConnection.ErrorMessage;
                    if (string.IsNullOrEmpty(text))
                    {
                        text = AfaStrings.ErrorConnectingToServer;
                    }
                    ErrorReport.ShowErrorMessage(text);
                    return;
                }
                Mouse.OverrideCursor = null;
                if (aGSConnection.FoldersLoaded && !aGSConnection.ConnectionFailed)
                {
                    this.Succeeded = true;
                    aGSConnection.SaveToFile();
                    App.Connections.Add(aGSConnection);
                    SelectService selectService = new SelectService(aGSConnection);
                    if (selectService.IsValid)
                    {
                        Autodesk.AutoCAD.ApplicationServices.Core.Application.ShowModalWindow(selectService);
                        if (selectService.DialogResult.HasValue)
                        {
                            bool arg_165_0 = selectService.DialogResult.Value;
                        }
                    }
                }
            }
        }