예제 #1
0
        public override void Report(FileSystemFinderProgress value)
        {
            if (value.Error != null)
            {
                return;
            }

            switch (value.Kind)
            {
            case ProgressKind.SearchedDirectory:
            {
                SearchedDirectoryCount++;
                break;
            }

            case ProgressKind.Directory:
            {
                DirectoryCount++;
                WriteProgress();
                break;
            }

            case ProgressKind.File:
            {
                FileCount++;
                WriteProgress();
                break;
            }

            default:
            {
                throw new InvalidOperationException($"Unknown enum value '{value.Kind}'.");
            }
            }
        }
예제 #2
0
        public override void Report(FileSystemFinderProgress value)
        {
            if (value.Error != null)
            {
                Write("[E] ", Colors.Path_Progress);
                WriteWarning(value.Error, verbosity: Verbosity.Diagnostic);
            }
            else
            {
                switch (value.Kind)
                {
                case ProgressKind.SearchedDirectory:
                {
                    SearchedDirectoryCount++;

                    if (ConsoleReportMode == ProgressReportMode.Path)
                    {
                        WritePath(value.Path, value.Kind, Indent);
                    }
                    else if (FileReportMode == ProgressReportMode.Path)
                    {
                        WritePathToFile(value.Path, value.Kind);
                    }

                    break;
                }

                case ProgressKind.Directory:
                {
                    DirectoryCount++;
                    WritePath(value.Path, value.Kind);
                    break;
                }

                case ProgressKind.File:
                {
                    FileCount++;
                    WritePath(value.Path, value.Kind);
                    break;
                }

                default:
                {
                    throw new InvalidOperationException($"Unknown enum value '{value.Kind}'.");
                }
                }
            }
        }