void mBW_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
        {
            if (mWindowClosing)
            {
                return;
            }

            if (e.Cancelled)
            {
                mSbLog.AppendFormat("Task stopped.\n");
            }
            else
            {
                mSbLog.AppendFormat("Elapsed time = {0}\n", mStopWatch.Elapsed);
            }

            mTextBoxLog.Text = mSbLog.ToString();
            mTextBoxLog.ScrollToEnd();

            mStopWatch.Stop();
            mStopWatchLogUpdate.Stop();

            mProgressBar.Value     = 0;
            mButtonStart.IsEnabled = true;
            mButtonStop.IsEnabled  = false;

            if (mReader != null)
            {
                mReader.Dispose();
                mReader = null;
            }
        }
        private void mButtonStart_Click(object sender, RoutedEventArgs e)
        {
            // ログを更新。
            mSbLog.Clear();
            mLogCounter     = 0;
            mLogShowCounter = 0;
            mSbLog.AppendFormat("Read Started. IsParallel={0}, Folder={1}\n",
                                mCheckBoxParallelRead.IsChecked == true,
                                mTextBoxFolder.Text);
            mTextBoxLog.Text = mSbLog.ToString();

            mStopWatch.Restart();
            mStopWatchLogUpdate.Restart();

            // Reader作成。
            System.Diagnostics.Debug.Assert(mReader == null);
            mReader = new ReadAllFilesOnFolder(ReadProgressCallback_WindowMode);

            mBW.RunWorkerAsync(new BWArgs(mTextBoxFolder.Text, mCheckBoxParallelRead.IsChecked == true));

            mButtonStart.IsEnabled = false;
            mButtonStop.IsEnabled  = true;
        }
        private bool ParseCommandline()
        {
            var args = System.Environment.GetCommandLineArgs();

            if (2 != args.Length && 3 != args.Length)
            {
                PrintUsage(args[0]);
                return(false);
            }

            string folder = args[args.Length - 1];

            int opt = 0;

            if (args.Length == 3)
            {
                if (0 != "-Parallel".CompareTo(args[1]))
                {
                    PrintUsage(args[0]);
                    return(false);
                }
                opt = (int)ReadAllFilesOnFolder.Option.Parallel;
            }

            // コマンドライン実行する。
            mStopWatch.Restart();
            mStopWatchLogUpdate.Restart();
            Console.WriteLine("IsParallel={0}, Folder={1}", opt, folder);
            var r = new ReadAllFilesOnFolder(ReadProgressCallback_Console);

            r.Run(folder, opt);
            r.Dispose();
            r = null;

            Console.WriteLine("Done. Elapsed time = {0}", mStopWatch.Elapsed);
            return(true);
        }