示例#1
0
        private void btGo_Click(object sender, EventArgs e)
        {
            this.Cursor  = Cursors.WaitCursor;
            btGo.Enabled = false;

            try
            {
                WriteConfiguration();

                if (String.IsNullOrEmpty(Server.Address) || String.IsNullOrEmpty(Server.Password) ||
                    String.IsNullOrEmpty(Server.Port) || String.IsNullOrEmpty(Server.Username))
                {
                    Dialog.Error(Resource.InvalidServerConfiguration);
                }
                else if (String.IsNullOrEmpty(DefinitionFilename))
                {
                    Dialog.Error(Resource.EmptyDefinitionFilename);
                }
                else if (String.IsNullOrEmpty(Target.Address) || String.IsNullOrEmpty(Target.Username) ||
                         String.IsNullOrEmpty(Target.Password) || (txtSSHPort != null && String.IsNullOrEmpty(Target.SSHPort)))
                {
                    Dialog.Error(Resource.InvalidTargetConfiguration);
                }
                else if (String.IsNullOrEmpty(DestinationFolder))
                {
                    Dialog.Error(Resource.EmptyDestinationFolderName);
                }
                else
                {
                    var hasExternalVariable = ((ExternalVariables != null) && (ExternalVariables.Count() > 0));
                    if (hasExternalVariable)
                    {
                        var externalVariableWindow = new ExternalVariableWindow(this);
                        if (externalVariableWindow.ShowDialog() != DialogResult.OK)
                        {
                            return;
                        }
                    }

                    SaveExternalVariableXml();

                    var collectionWindow = new CollectionWindow(this.Server, this.Target, this.DefinitionFilename, this.DestinationFolder, this.ExternalVariablesXml);
                    collectionWindow.ShowDialog();
                }
            }
            finally
            {
                btGo.Enabled = true;
                this.Cursor  = Cursors.Default;
            }
        }
示例#2
0
        private void btGo_Click(object sender, EventArgs e)
        {
            this.Cursor = Cursors.WaitCursor;
            btGo.Enabled = false;

            try
            {
                WriteConfiguration();

                if (String.IsNullOrEmpty(Server.Address) || String.IsNullOrEmpty(Server.Password)
                    || String.IsNullOrEmpty(Server.Port) || String.IsNullOrEmpty(Server.Username))
                {
                    Dialog.Error(Resource.InvalidServerConfiguration);
                }
                else if (String.IsNullOrEmpty(DefinitionFilename))
                {
                    Dialog.Error(Resource.EmptyDefinitionFilename);
                }
                else if (String.IsNullOrEmpty(Target.Address) || String.IsNullOrEmpty(Target.Username)
                    || String.IsNullOrEmpty(Target.Password) || (txtSSHPort != null && String.IsNullOrEmpty(Target.SSHPort)))
                {
                    Dialog.Error(Resource.InvalidTargetConfiguration);
                }
                else if (String.IsNullOrEmpty(DestinationFolder))
                {
                    Dialog.Error(Resource.EmptyDestinationFolderName);
                }
                else
                {
                    var hasExternalVariable = ((ExternalVariables != null) && (ExternalVariables.Count() > 0));
                    if (hasExternalVariable)
                    {
                        var externalVariableWindow = new ExternalVariableWindow(this);
                        if (externalVariableWindow.ShowDialog() != DialogResult.OK)
                        {
                            return;
                        }
                    }

                    SaveExternalVariableXml();

                    var collectionWindow = new CollectionWindow(this.Server, this.Target, this.DefinitionFilename, this.DestinationFolder, this.ExternalVariablesXml);
                    collectionWindow.ShowDialog();
                }
            }
            finally
            {
                btGo.Enabled = true;
                this.Cursor = Cursors.Default;
            }
        }