Exemplo n.º 1
0
        /// <summary>
        /// Update directory scan progress indicator.
        /// </summary>
        void _directoryEngine_OnUpdateDirectoryScan(object sender, EventParameters2 eventArgs)
        {
            switch (eventArgs.Method)
            {
            case "DirList":
                string phase         = _processingNew ? "Source" : "Target";
                string messageFormat = "Scanning {0}: {1} %, Bytes So Far = {2}, Estimated total bytes = {3}";
                string numberFormat  = "#,##0";
                if (_processingNew)
                {
                    ActionUpdateProgress(_currentActivityProgress, eventArgs.Increment);
                    _copyViewer.StatusMessage           = String.Format(messageFormat, phase, _currentActivityProgress.Value, _SoFarBytes.ToString(numberFormat), _TotalBytes.ToString(numberFormat));
                    _copyViewer.CurrentActivityProgress = _currentActivityProgress;
                }
                else
                {
                    ActionUpdateProgress(_overallProgress, eventArgs.Increment);
                    _copyViewer.StatusMessage   = String.Format(messageFormat, phase, _overallProgress.Value, _SoFarBytes.ToString(numberFormat), _TotalBytes.ToString(numberFormat));
                    _copyViewer.OverallProgress = _overallProgress;
                }
                break;

            case "Changes":
                break;

            case "Comparisons":
                break;
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Start directory scan progress indicator.
        /// </summary>
        void _directoryEngine_OnBeginDirectoryScan(object sender, EventParameters2 eventArgs)
        {
            switch (eventArgs.Method)
            {
            case "DirList":
                _copyViewer.CursorMode    = CursorModes.Wait;
                _copyViewer.StatusMessage = "Scanning directories ...";
                _SoFarBytes = 0;
                if (_processingNew)
                {
                    _TotalBytes = 0;
                    _currentActivityProgress = new ProgressLink();
                    ActionBeginProgress(_currentActivityProgress);
                    _copyViewer.CurrentActivityProgress = _currentActivityProgress;
                }
                else
                {
                    _overallProgress = new ProgressLink();
                    ActionBeginProgress(_overallProgress);
                    _copyViewer.OverallProgress = _overallProgress;
                }
                break;

            case "Changes":
                break;

            case "Comparisons":
                break;
            }
        }
Exemplo n.º 3
0
        /// <summary>
        /// End directory scan progress indicator.
        /// </summary>
        void _directoryEngine_OnEndOfDirectoryScan(object sender, EventParameters2 eventArgs)
        {
            switch (eventArgs.Method)
            {
            case "DirList":
                string message = string.Empty;
                if (_directoryEngine.Interrupt.Reason == "Cancel")
                {
                    message = "Directory scan cancelled.";
                }
                else
                {
                    message = "Directory scan complete.";
                }
                if (_processingNew)
                {
                    ActionEndOfProgress(_currentActivityProgress);
                    _currentActivityProgress.Value      = _currentActivityProgress.Maximum;
                    _copyViewer.CurrentActivityProgress = _currentActivityProgress;
                }
                else
                {
                    ActionEndOfProgress(_overallProgress);
                    _overallProgress.Value      = _overallProgress.Maximum;
                    _copyViewer.OverallProgress = _overallProgress;
                }
                _copyViewer.StatusMessage = message;
                _copyViewer.CursorMode    = CursorModes.Normal;
                break;

            case "Changes":
                break;

            case "Comparisons":
                break;
            }
        }