private void FinishTransfer()
        {
            _queue = null;
            _statistics.TimeSpentWithTransfer += _elapsedTimeMeter.Elapsed;
            if (_remoteCopy != RemoteCopyMode.Disabled)
            {
                CloseTelnetSession();
            }
            _elapsedTimeMeter.Stop();
            ProgressState = TaskbarItemProgressState.None;

            var args = new TransferFinishedEventArgs(this, SourcePane, TargetPane);

            if (_shutdown != Shutdown.Disabled && (UserAction == FileOperation.Copy || UserAction == FileOperation.Move))
            {
                ShutdownDialogViewModel vm;
                if (_shutdown.HasFlag(Shutdown.Xbox))
                {
                    var ftp = Pane <FtpContentViewModel>();
                    if (ftp == SourcePane)
                    {
                        _sourceChanged = false;
                    }
                    if (ftp == TargetPane)
                    {
                        _targetChanged = false;
                    }
                    vm = new ShutdownDialogViewModel(WindowManager, _shutdown, ftp);
                }
                else
                {
                    vm = new ShutdownDialogViewModel(WindowManager, _shutdown);
                }
                WindowManager.ShowModelessWindow <ShutdownDialog, ShutdownDialogViewModel>(vm);
            }

            if (_sourceChanged)
            {
                SourcePane.Refresh(false);
            }
            if (_targetChanged && TargetPane != null)
            {
                TargetPane.Refresh(false);
            }
            EventAggregator.GetEvent <TransferFinishedEvent>().Publish(args);

            SourcePane = null;
            TargetPane = null;
        }
예제 #2
0
 private void NewFolderSuccess(TransferResult result, string name)
 {
     if (result != TransferResult.Ok)
     {
         WindowManager.ShowMessage(Resx.AddNewFolder, string.Format(Resx.FolderAlreadyExists, name));
         return;
     }
     SourcePane.Refresh(false, () =>
     {
         var newFolder = SourcePane.Items.SingleOrDefault(item => item.Name == name);
         if (newFolder != null)
         {
             SourcePane.CurrentRow = newFolder;
         }
     });
 }