Example #1
0
 public void RegisterVoiceCommand(string commandstring, VoiceCommandHandler handler)
 {
     commandstring = commandstring.ToLower();
     if (!VoiceCommands.Contains(commandstring) && commandstring != "help")
     {
         logfile.WriteLine("CSAI registering voicecommand " + commandstring);
         VoiceCommands.Add(commandstring, handler);
     }
 }
        public AwesomeBotClient(ImagesCommandHandler imagesCommandHandler, VoiceCommandHandler voiceCommandHandler,
                                DocxCommandHandler docxCommandHandler, PdfCommandHandler pdfCommandHandler, TelegramBotClient botCLient)
        {
            _botClient = botCLient;

            _imagesCommandHandler = imagesCommandHandler;
            _voiceCommandHandler  = voiceCommandHandler;
            _docxCommandHandler   = docxCommandHandler;
            _pdfCommandHandler    = pdfCommandHandler;
        }
        public static async void SetEndDevices(ObservableCollection <ZigBeeEndDevice> collection)
        {
            List <ValueSet> list = new List <ValueSet>();

            foreach (ZigBeeEndDevice endDevice in collection)
            {
                foreach (ZigBeeEndPoint endPoint in endDevice.EndPoints)
                {
                    ValueSet vs = new ValueSet();
                    Debug.WriteLine(string.Format("endPoint.Id {0} #  endPoint.CustomName {1}", endPoint.Id, endPoint.CustomName));
                    list.Add(new ValueSet {
                        { "Id", endPoint.Id }, { "Name", endPoint.CustomName }
                    });
                }
            }

            await Windows.ApplicationModel.Core.CoreApplication.MainView.CoreWindow.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, async() =>
            {
                try
                {
                    var message = new ValueSet();
                    message.Add("Type", "ZigBee");
                    message.Add("Command", "SetEndDevices");
                    message.Add("Param", JsonConvert.SerializeObject(list));

                    ValueSet ReturnData = IOTOI.Common.CommonService.GetReturnData(message);

                    Debug.WriteLine(ReturnData["Status"].ToString());

                    string phList = null;
                    if (ReturnData.ContainsKey("Status"))
                    {
                        if (ReturnData["Status"] != null)
                        {
                            Debug.WriteLine(ReturnData["Status"].ToString());
                            phList = ReturnData["Result"].ToString();
                        }
                    }

                    #region Call Cortana Update
                    VoiceCommandHandler voiceCommandHandler = new VoiceCommandHandler();
                    await Task.Run(async() => await voiceCommandHandler.SetPhraseList(phList));
                    #endregion
                }
                catch (Exception e)
                {
                    String test = e.Message;
                }
            });
        }
Example #4
0
 public void RegisterVoiceCommand( string commandstring, VoiceCommandHandler handler )
 {
     commandstring = commandstring.ToLower();
     if( !VoiceCommands.Contains( commandstring ) && commandstring != "help" )
     {
         logfile.WriteLine("CSAI registering voicecommand " + commandstring );
         VoiceCommands.Add( commandstring, handler );
     }
 }
Example #5
0
 public VoiceCommandInfo(string command, VoiceCommandHandler handler)
 {
     this.command = command;
     this.handler = handler;
 }
Example #6
0
 public VoiceCommandInfo(string command, VoiceCommandHandler handler)
 {
     this.command = command;
     this.handler = handler;
 }