Exemple #1
0
        public MainWindowViewModel()
        {
            // Only one argument is supported - the path in which to search.
            var args = Environment.GetCommandLineArgs();

            if (args.Length > 1)
            {
                var dir = args[1].Trim(new char[] { '"', '\\' }) + "\\";
                if (Directory.Exists(dir))
                {
                    _searchPath = dir;
                }
            }

            FoundFiles             = new ObservableCollection <FoundFileViewModel>();
            TextContentViewModel   = new TextContentViewModel();
            BinaryContentViewModel = new BinaryContentViewModel();
            SearchCommand          = new ActionCommand(RunSearch);
            mSelectedFiles         = new List <FoundFileViewModel>();
            _executor = new SearchExecutor(this);
            _worker   = new BackgroundWorker {
                WorkerSupportsCancellation = true
            };
            _worker.DoWork             += worker_DoWork;
            _worker.RunWorkerCompleted += worker_RunWorkerCompleted;
        }
 public RegexWindowViewModel()
 {
     TitleText            = "Regex Options";
     TextContentViewModel = new TextContentViewModel()
     {
         SelectedFileCount = 1, ShowFullContent = true
     };
 }