private async void MainPage_Loaded(object sender, RoutedEventArgs e) { List <SerialPortTuple> serialPorts = await GetAvailableSerialPorts(); SerialPortComboBox.DisplayMemberPath = "Name"; SerialPortComboBox.SelectedValuePath = "Id"; SerialPortComboBox.ItemsSource = serialPorts; speakerImpl = new Speaker(media); joystick = new GenericJoystick(); InitWebServer(serialPorts); Speak("Ready"); }
private void MainPage_Unloaded(object sender, RoutedEventArgs e) { if (httpServer != null) { httpServer.Dispose(); } if (isWorkerRunning) { StopWorker(); } joystick.Dispose(); joystick = null; }
public ShortyTheRobot(ISpeaker speaker, IJoystickController joystick, int loopTimeMs) { this.speaker = speaker; this.joystick = joystick; this.loopTimeMs = loopTimeMs; }
private async void MainPage_Loaded(object sender, RoutedEventArgs e) { List<SerialPortTuple> serialPorts = await GetAvailableSerialPorts(); SerialPortComboBox.DisplayMemberPath = "Name"; SerialPortComboBox.SelectedValuePath = "Id"; SerialPortComboBox.ItemsSource = serialPorts; speakerImpl = new Speaker(media); joystick = new GenericJoystick(); InitWebServer(serialPorts); Speak("Ready"); }
private void MainPage_Unloaded(object sender, RoutedEventArgs e) { if(httpServer != null) httpServer.Dispose(); if (isWorkerRunning) { StopWorker(); } joystick.Dispose(); joystick = null; }