Exemple #1
0
        private async Task Launch()
        {
            //DeploymentTask task = null;

            ClouderSyncPackage.WriteToOutputWindow("-----\n", "ClouderSync", null, true);

            if (!ConnectEntryData.SettingsExist())
            {
                ShowMessageBox(@"It does not appear that SFTP connection has been configured. Please configure in the next step", "ClouderSync SSH");
                cmdConfigureSSH.ConfigureSSH(this);
                return;
            }
            if (DeploymentTask.GetIsRunning())
            {
                ShowMessageBox(@"It appears that a deployment task is running. Please cancel, or wait, or restart Visual Studio", "ClouderSync SSH");
                return;
            }
            CancellationTokenSource tokenSource = new CancellationTokenSource();
            CancellationToken       token       = tokenSource.Token;

            DeploymentTask task = new DeploymentTask(this);
            await Task.Run(() =>
            {
                task.Execute(tokenSource);
            });
        }
Exemple #2
0
        private void backgroundWorker_DoWork(object sender, DoWorkEventArgs eArgs)
        {
            DeploymentTask task = null;

            if (eArgs.Argument is DeploymentTask)
            {
                task = eArgs.Argument as DeploymentTask;
            }
            if (task != null)
            {
                task.Execute();
            }
            else
            {
                string message = string.Format(CultureInfo.CurrentCulture, "Failed to pass SFTP DeploymentTask {0}", this.GetType().FullName);
                ShowMessageBox(message, "ClouderSync Deploy");
            }
        }