private void GpsInformation_StateChangedEventHandler(object sender, GpsInformation.StateChangedEventArgs e) { if (this.currentGpsStatus == GpsInformation.GpsStatus.Active && e.State != GpsInformation.GpsStatus.Active) { this.WriteToOutputTextBlock("GPS connection lost..."); // this.Speak("GPS connection lost..."); } if (this.currentGpsStatus != e.State) { this.currentGpsStatus = e.State; this.WriteToOutputTextBlock("GPS Status: " + this.currentGpsStatus.ToString()); this.UpdateUiButtonStates("gps", this.currentGpsStatus == GpsInformation.GpsStatus.Active ? Commands.ToggleCommandState.On : Commands.ToggleCommandState.Off); } }
private void InitializeGps() { this.gpsInformation = new GpsInformation(Constants.GpsBaudRate); this.currentGpsStatus = GpsInformation.GpsStatus.None; this.gpsInformation.StateChangedEventHandler += this.GpsInformation_StateChangedEventHandler; }