Exemple #1
0
        public SpeakController(AlertingService alertingService)
        {
            _alertingService = alertingService;

            _historyRepository = new FileSpeechHistoryRepository();
            _snoozeService     = new FileSnoozeService();
        }
Exemple #2
0
        public void BasicTest()
        {
            var config = Options.Create <PolycomAudioTransmitterConfiguration>(new PolycomAudioTransmitterConfiguration()
            {
                BindingIp = "10.1.10.54"
            });

            ISynthesizeSpeech synthesizeSpeech = new SystemSpeechSynthesizer();
            IAudioTransmitter audioTransmitter = new PolycomAudioTransmitter(config);

            AlertingService aservice = new AlertingService(synthesizeSpeech, audioTransmitter);

            aservice.Speak(3, "Whatcha lookin at");
        }
Exemple #3
0
        public async Task <IActionResult> Create(
            [Bind("Id,Url")] RecurringAlert recurringAlert)
        {
            if (ModelState.IsValid)
            {
                recurringAlert.CreatedOn         = DateTime.Now;
                recurringAlert.ApplicationUserId = _userManager.GetUserId(HttpContext.User);
                recurringAlert.EmailAddress      = (await _userManager.GetUserAsync(HttpContext.User)).Email;
                _context.Add(recurringAlert);
                await _context.SaveChangesAsync();

                _alertingService.AddJob(recurringAlert.Url, recurringAlert.EmailAddress);
                BackgroundJob.Enqueue(
                    () => AlertingService.NewUserConfirmation(recurringAlert.Url, recurringAlert.EmailAddress));
                return(RedirectToAction("Index"));
            }
            ViewData["ApplicationUserId"] = new SelectList(_context.Set <ApplicationUser>(), "Id", "Id",
                                                           recurringAlert.ApplicationUserId);
            return(View(recurringAlert));
        }
 public SpeakController(AlertingService alertingService)
 {
     _alertingService = alertingService;
 }
 public TestController(AlertingService alertingService)
 {
     _alertingService = alertingService;
 }