Beispiel #1
0
        /// <summary>
        /// Gets the current location.
        /// </summary>
        /// <returns>
        /// The current location represented as <see cref="ILocation"/>. If no location is available, <c>null</c> will be returned.
        /// </returns>
        public ILocation GetCurrentLocation()
        {
            var currentCoordinate = _geoCoordinateWatcher.Position;
            var currentLocation = new Location(currentCoordinate.Location);

            return currentLocation;
        }
Beispiel #2
0
        /// <summary>
        /// Gets the current location.
        /// </summary>
        /// <returns>
        /// The current location represented as <see cref="ILocation"/>. If no location is available, <c>null</c> will be returned.
        /// </returns>
        public ILocation GetCurrentLocation()
        {
            ILocation currentLocation = null;

            if (_hasLocation)
            {
                var currentCoordinate = _geoCoordinateWatcher.Position;
                currentLocation = new Location(currentCoordinate.Location);
            }

            return currentLocation;
        }