private void OnListenerPositionChanged(object sender, PositionEventArgs e) { if (!IsListening) // ignore anything that might come in afterwards { return; } lock (positionSync) { lastPosition = e.Position; OnPositionChanged(e); } }
void OnPositionChanged(PositionEventArgs e) => PositionChanged?.Invoke(this, e);
protected virtual void OnPositionChanged(PositionEventArgs e) => PositionChanged?.Invoke(this, e);