コード例 #1
0
        private void ProcessProgressEvent(ConsoleProgressEventStruct e)
        {
            using (_logger.CreateCallstack())
            {
                _logger.WriteLine(
                    "File Name [{0}] - Directory [{1}] - Overall Progress [{2}] - File Progress [{3}] - CPS [{4}]",
                    e.FileName, e.Directory, e.OverallProgress, e.FileProgress, e.CPS);

                if (!_cancel)
                {
                    FileTransferProgressEventArgs args = new FileTransferProgressEventArgs();

                    switch (e.Operation)
                    {
                    case ConsoleProgressEventStruct.ProgressOperation.Copy:
                        args.Operation = ProgressOperation.Transfer;
                        break;

                    default:
                        throw _logger.WriteException(new ArgumentOutOfRangeException("Unknown progress operation", (Exception)null));
                    }

                    switch (e.Side)
                    {
                    case ConsoleProgressEventStruct.ProgressSide.Local:
                        args.Side = ProgressSide.Local;
                        break;

                    case ConsoleProgressEventStruct.ProgressSide.Remote:
                        args.Side = ProgressSide.Remote;
                        break;

                    default:
                        throw _logger.WriteException(new ArgumentOutOfRangeException("Unknown progress side", (Exception)null));
                    }

                    args.FileName        = e.FileName;
                    args.Directory       = e.Directory;
                    args.OverallProgress = ((double)e.OverallProgress) / 100;
                    args.FileProgress    = ((double)e.FileProgress) / 100;
                    args.CPS             = (int)e.CPS;
                    args.Cancel          = false;

                    _session.ProcessProgress(args);
                }

                if (_cancel)
                {
                    e.Cancel = true;
                }
            }
        }
コード例 #2
0
        private void ProcessProgressEvent(ConsoleProgressEventStruct e)
        {
            using (_logger.CreateCallstack())
            {
                _logger.WriteLine(
                    "File Name [{0}] - Directory [{1}] - Overall Progress [{2}] - File Progress [{3}] - CPS [{4}]",
                    e.FileName, e.Directory, e.OverallProgress, e.FileProgress, e.CPS);

                FileTransferProgressEventArgs args = new FileTransferProgressEventArgs();

                switch (e.Operation)
                {
                    case ConsoleProgressEventStruct.ProgressOperation.Copy:
                        args.Operation = ProgressOperation.Transfer;
                        break;

                    default:
                        throw new ArgumentOutOfRangeException("Unknown progress operation", (Exception)null);
                }

                switch (e.Side)
                {
                    case ConsoleProgressEventStruct.ProgressSide.Local:
                        args.Side = ProgressSide.Local;
                        break;

                    case ConsoleProgressEventStruct.ProgressSide.Remote:
                        args.Side = ProgressSide.Remote;
                        break;

                    default:
                        throw new ArgumentOutOfRangeException("Unknown progress side", (Exception)null);
                }

                args.FileName = e.FileName;
                args.Directory = e.Directory;
                args.OverallProgress = ((double)e.OverallProgress) / 100;
                args.FileProgress = ((double)e.FileProgress) / 100;
                args.CPS = (int) e.CPS;
                _session.ProcessProgress(args);
            }
        }
コード例 #3
0
ファイル: Session.cs プロジェクト: Rupan/winscp
 private void Progress(FileTransferProgressEventArgs args)
 {
     if ((_progressHandling >= 0) && WantsProgress)
     {
         _fileTransferProgress(this, args);
     }
 }
コード例 #4
0
ファイル: Session.cs プロジェクト: Rupan/winscp
 internal void ProcessProgress(FileTransferProgressEventArgs args)
 {
     ScheduleEvent(() => Progress(args));
 }
コード例 #5
0
 private void SessionFileTransferProgress(object sender, WinSCP.FileTransferProgressEventArgs e)
 {
     Console.WriteLine("Synchronise file: {0}, progress: {1}", e.FileName, e.FileProgress);
 }
コード例 #6
0
ファイル: SessionManager.cs プロジェクト: mkramers/Projects
        private void SessionFileTransferProgress(object sender, FileTransferProgressEventArgs e)
        {
            // Print transfer progress
            LOG.InfoFormat("\r{0} ({1:P0} CPS = {2})", e.FileName, e.FileProgress, e.CPS);

            // Remember a name of the last file reported
            m_lastFileName = e.FileName;
        }
コード例 #7
0
 public static void FileTransferProgress(object sender, FileTransferProgressEventArgs e)
 {
     fenetrePrincipale.label11.Text = ": " + e.FileName.Replace(cheminARMA3, "");
     fenetrePrincipale.label19.Text = ": " + Path.GetDirectoryName(e.Directory).Replace (cheminARMA3,"");
     fenetrePrincipale.progressBar2.Value = int.Parse(Math.Truncate(e.FileProgress * 100).ToString());
     fenetrePrincipale.progressBar3.Value = int.Parse(Math.Truncate(e.OverallProgress * 100).ToString());
 }
コード例 #8
0
 private void SessionFileTransferProgress(object sender, FileTransferProgressEventArgs e)
 {
     bpLoadFile.Value = Convert.ToInt32(e.FileProgress * 100);
       bpLoadFile.Update();
 }