private void UpdateLocation() { double latitude, longitude; this.m_errorMessage = null; if (!double.TryParse(this.m_latitudeString, out latitude)) { if (!AngleUtils.TryParseDMS(this.m_latitudeString, out latitude)) { this.m_errorMessage = "Invalid latitude"; return; } } if (!double.TryParse(this.m_longitudeString, out longitude)) { if (!AngleUtils.TryParseDMS(this.m_longitudeString, out longitude)) { this.m_errorMessage = "Invalid longitude"; return; } } var location = new GlobalLocation(this.TargetLocation.Body, new Coordinates(latitude: latitude, longitude: longitude)); this.m_module.SetTargetLocation(location); Reset(); }