示例#1
0
 private void queueStatusButton_Click(object sender, EventArgs e)
 {
     if (Uploader.State == UploaderState.NotRunning)
     {
         Uploader.StartUploader();
     }
     else
     {
         Uploader.CancelAll();
     }
 }
示例#2
0
        private void EndIfShouldEnd()
        {
            if (EndAfterUpload &&
                WatchedProcesses.AllProcessesCompleted &&
                Uploader.State != UploaderState.Uploading &&
                (Uploader.State != UploaderState.Waiting || !Uploader.Queue.Any(u => u.State == JobState.NotStarted && !u.ShouldBeSkipped)) &&
                Searcher.State != RunningState.Running)
            {
                LOGGER.Info($"Auto uploader should end now");

                Uploader.CancelAll();
                DirectoryWatcher.Cancel();
                RefreshState();
            }
        }
示例#3
0
        public void Cancel(bool cancelYoutubeUploader)
        {
            LOGGER.Debug($"Received cancel request");

            if (State == RunningState.Running)
            {
                LOGGER.Info($"Cancelling auto uploader");

                State = RunningState.CancelPending;
                Uploader.StopAfterCompleting = true;
                Searcher.Cancel();
                DirectoryWatcher.Cancel();

                if (cancelYoutubeUploader)
                {
                    LOGGER.Info($"Cancelling youtube uploader");
                    Uploader.CancelAll();
                }

                RefreshState();
            }
        }