private void RegisterCommands(AlexaSmartListenercs listenercs) { foreach (string commands in listenercs.VoiceCommands.Keys) { Commands[commands] = listenercs.VoiceCommands[commands]; } }
public static void Main(string[] args) { AlexaSmartListenercs listener = new AlexaSmartListenercs(); AlexaSmartControl control = new AlexaSmartControl(listener); Console.WriteLine("Bem vindo a sua assitente virtual Alexa: oque posso lhe ajudar?"); int count = 0; while (!control.ShutDownCommand) { Console.WriteLine("Ligado..."); count++; listener.ProcessVoiceCommand("onLight"); if (count == 10) { control.RunShutDownCommand(); } } }
public AlexaSmartControl(AlexaSmartListenercs listener) { RegisterCommands(listener); listener.EmitCommand += Listener_EmitCommand; }