public MainViewModel(ITtsService ttsService)
        {
            // .... set up shit
            this.ttsService = ttsService;
            ttsService.AddWordCallback(ttsService_wordCallback);

            // .... process command line args
            var args = new CommandLineArgs(Environment.GetCommandLineArgs());

            if (args.ArgumentError)
            {
                System.Windows.Application.Current.Shutdown();
                return;
            }
            if (args.ShowHelp)
            {
                args.PrintHelpStringToConsole();
                System.Windows.Application.Current.Shutdown();
                return;
            }
            if (args.Filename == null)
            {
                Console.WriteLine("Please specify filename as command line argument");
                System.Windows.Application.Current.Shutdown();
                return;
            }
            if (args.Rate != null)
            {
                ttsService.SetVoiceOverrideSpeed(args.Rate);
            }

            // .... commands
            GoNextSentence    = new RelayCommand(GoNextSentenceFn);
            RepeatCurSentence = new RelayCommand(RepeatCurSentenceFn);

            // .... load input file
            var allLines = File.ReadAllLines(args.Filename);

            sentenceEnumerator = allLines.AsEnumerable().GetEnumerator();

            CurText = "";
            curLang = args.Lang;
        }
 public DocumentReaderByParagraph(ITtsService ttsService)
 {
     this.ttsService = ttsService;
     ttsService.AddWordCallback(ttsService_Word);
     searching = new ContextualSearchState();
 }