示例#1
0
        public ResultContainer DeepCopy()
        {
            var copy = new ResultContainer();

            foreach (var r in Results)
            {
                copy.Add(r);
            }

            return(copy);
        }
示例#2
0
        private ResultContainer convertResult(dynamic rawResult, FileInfo file)
        {
            var results = new ResultContainer();

            foreach (var line in rawResult)
            {
                var result = new Result(
                    file,
                    line.Index + 1,
                    line.Value);
                results.Add(result);
            }
            return(results);
        }
示例#3
0
        /// <summary>
        /// ディレクトリー収集
        /// </summary>
        /// <param name="dir">ディレクトリー</param>
        /// <param name="results">結果コンテナー</param>
        private void collectDirectory(DirectoryInfo dir, ResultContainer results)
        {
            if (this.Worker.CancellationPending)
            {
                //this.WorkerEventArgs.Cancel = true;
                return;
            }

            var result = new Result(dir, dir.Name);

            results.Add(result);

            this.Worker.ReportProgress(results.Results.Count);
        }
示例#4
0
        /// <summary>
        /// ファイル収集
        /// </summary>
        /// <param name="file">ファイル</param>
        /// <param name="results">結果コンテナー</param>
        private void collectFile(FileInfo file, ResultContainer results)
        {
            if (this.Worker.CancellationPending)
            {
                //this.WorkerEventArgs.Cancel = true;
                return;
            }

            var result = new Result(file, 0, file.Name);

            results.Add(result);

            this.Worker.ReportProgress(results.Results.Count);
        }