public void AbortTransfer()
        {
            if (SourcePane == null)
            {
                return;
            }

            _isAborted = true;
            if (_remoteCopy == RemoteCopyMode.Disabled)
            {
                SourcePane.Abort();
                if (TargetPane != null)
                {
                    TargetPane.Abort();
                }
            }
            lock (_queue)
            {
                var actualItem = _queue.Peek();
                _queue.Clear();
                _queue.Enqueue(actualItem);
            }
            if (_isPaused)
            {
                UIThread.BeginRun(FinishTransfer);
            }
        }
Ejemplo n.º 2
0
 private void UpdateManagerReportProgress(UpdateProgressInfo currentStatus)
 {
     UIThread.BeginRun(() =>
     {
         Message.Text   = currentStatus.Message;
         Progress.Value = currentStatus.Percentage;
     });
 }
Ejemplo n.º 3
0
 private void OnTransferFinished(TransferFinishedEventArgs e)
 {
     if (_transferProgressDialog != null)
     {
         _transferProgressDialog.Closing -= TransferProgressDialogOnClosing;
         if (_abortDialog != null) _abortDialog.Close(false);
         UIThread.BeginRun(() => _transferProgressDialog.Close());
     }
 }
 private void CheckUserMessages(object state)
 {
     UIThread.BeginRun(() =>
     {
         ViewModel.SetUserMessagesToRead((IUserMessageViewModel[])state);
         if (_userMessageReadTimers != null && _userMessageReadTimers.Count > 0)
         {
             _userMessageReadTimers.Dequeue();
         }
     });
 }
Ejemplo n.º 5
0
 private void FileManagerOnProgressChanged(object sender, ProgressChangedEventArgs e)
 {
     UIThread.BeginRun(() =>
     {
         var message = e.UserState as string;
         if (message != null)
         {
             ProgressMessage = message;
         }
         if (e.ProgressPercentage != -1)
         {
             ProgressValue = e.ProgressPercentage;
         }
     });
 }
Ejemplo n.º 6
0
        private void OnLoaded(object sender, RoutedEventArgs e)
        {
            var vm = (InputDialogViewModel)DataContext;

            switch (vm.Mode)
            {
            case InputDialogMode.Text:
                TextBox.Focus();
                break;

            case InputDialogMode.ComboBox:
                ComboBox.Focus();
                break;

            case InputDialogMode.RadioGroup:
                UIThread.BeginRun(() =>
                {
                    var option        = vm.Options.FirstOrDefault(o => o.Equals(vm.DefaultValue)) ?? vm.Options.First();
                    option.IsSelected = true;
                });
                break;
            }
        }
Ejemplo n.º 7
0
 void _sleep_Elapsed(object sender, ElapsedEventArgs e)
 {
     UIThread.BeginRun(Step);
 }