コード例 #1
0
ファイル: LocationService.cs プロジェクト: JaysonJG/Catel
        /// <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;
        }
コード例 #2
0
ファイル: LocationService.cs プロジェクト: pars87/Catel
        /// <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;
        }