Esempio n. 1
0
 public void Speak(string voicer, double volume, double rate, string content)
 {
     if (Voicers.Contains(voicer) == false)
     {
         return;
     }
     Check(ref volume, ref rate);
     BeginWork(() =>
     {
         Synth.SelectVoice(voicer);
         Synth.Volume = (int)volume;
         Synth.Rate   = (int)rate;
         Synth.Speak(content);
     });
 }
Esempio n. 2
0
        protected override void OnStartup(StartupEventArgs e)
        {
            base.OnStartup(e);
            Current.DispatcherUnhandledException += UnhandledExceptionHndlr.OnCurrentDispatcherUnhandledException;
            EventManager.RegisterClassHandler(typeof(TextBox), TextBox.GotFocusEvent, new RoutedEventHandler((s, re) => { (s as TextBox).SelectAll(); })); //tu: TextBox

#if DEBUG
            Tracer.SetupTracingOptions("MinFin", AppTraceLevel_inCode);
#else
            Tracer.SetupTracingOptions("MinFin", AppTraceLevel_Config);
#endif

#if _DEBUG
            //new ReportWindow(MSMoneyDbLoader.App.GetCmndLineArgsInclClickOnce())
            //new HstProcessorVw()

            //new DbLoaderReportWindow(MSMoneyDbLoader.App.GetCmndLineArgsInclClickOnce()) // 1
            //new HistoricalChartSet.MainHistChart()                // 2
            new TxCategoryAssignerVw()                      // 3
            //new ManualTxnEntry(true) //new MinFin.DataSet.TxAdd() // 4
            //new MinFin.Review.DS.ReviewWindow("Mei")              // 5
            .ShowDialog();

            //MinFin.Report.WinForm.Program.ShowBoth();
            //MinFin.Report.WinForm.Program.Show_Alx();
            //MinFin.Report.WinForm.Program.Show_Mei();
            //MinFin.Report.WinForm.Program.ShowDialogBoth();
#else
            var args = MSMoneyDbLoader.App.GetCmndLineArgsInclClickOnce(); // load cml specified file.
            if (args.Length > 0 && (File.Exists(args[0]) || Directory.Exists(args[0])))
            {
                new MSMoneyDbLoader.DbLoaderReportWindow(args).ShowDialog();
                if (!(args.Length > 1 && args[1].Equals("ShowMenu", System.StringComparison.OrdinalIgnoreCase)))
                {
                    Synth.Speak($"{args[0]} processed. Exiting.");
                    goto done;
                }
            }

            ShutdownMode = ShutdownMode.OnExplicitShutdown;
            new Views.MainAppDispatcher().ShowDialog();

done:
#endif

            App.Current?.Shutdown();
        }
Esempio n. 3
0
 public void Generated(string voicer, double volume, double rate, string content, string file)
 {
     if (Voicers.Contains(voicer) == false)
     {
         return;
     }
     Check(ref volume, ref rate);
     BeginWork(() =>
     {
         var path = new System.IO.FileInfo(file);
         if (path.Directory.Exists == false)
         {
             System.IO.Directory.CreateDirectory(path.Directory.FullName);
         }
         Synth.SelectVoice(voicer);
         Synth.Volume = (int)volume;
         Synth.Rate   = (int)rate;
         Synth.SetOutputToWaveFile(file);
         Synth.Speak(content);
         Synth.SetOutputToDefaultAudioDevice();
     });
 }
Esempio n. 4
0
 public void Speak(string message)
 {
     Synth.Speak(message);
 }