public void OnPositionChanged(Position position) { var handler = PositionChanged; if (handler != null) PositionChanged(this, new PositionChangedEventArgs(position, this)); }
public PositionChangedEventArgs(Position position, ImbClientStatus status) { ClientStatus = status; Position = position; }
internal void UpdatePosition(string c) { var cc = c.Split('|'); try { var p = new Position { Date = DateTime.Now, Latitude = double.Parse(cc[0], CultureInfo.InvariantCulture), Longitude = double.Parse(cc[1], CultureInfo.InvariantCulture), Precision = double.Parse(cc[2], CultureInfo.InvariantCulture), Course = double.Parse(cc[3], CultureInfo.InvariantCulture), Speed = double.Parse(cc[4], CultureInfo.InvariantCulture) }; Position = p; OnPositionChanged(p); } catch (Exception) { Console.WriteLine("Error parsing position "); } }