Container class for the two double values of Latitude and Longitude
Пример #1
0
        /// <summary>
        /// Set the Latitude and Longitude to the Registry.
        /// </summary>
        /// <param name="latLong">The <see cref="LatLong"/>.</param>
        public static void SetLatLong(LatLong latLong)
        {
            try
            {
                var key = Registry.LocalMachine.OpenSubKey(Path, true);

                key.SetValue(LatitudeProperty, latLong.Latitude);
                key.SetValue(LongitudeProperty, latLong.Longitude);

                key.Close();
            }
            catch (Exception ex)
            {
                if (Debugger.IsAttached)
                {
                    Debugger.Break();
                }

                // just re-throw for now
                // potentially catch specific exceptions for better handling
                throw ex;
            }
        }
Пример #2
0
        /// <summary>
        /// Set the Latitude and Longitude to the Registry.
        /// </summary>
        /// <param name="latLong">The <see cref="LatLong"/>.</param>
        public static void SetLatLong(LatLong latLong)
        {
            try
            {
                var key = Registry.LocalMachine.OpenSubKey(Path, true);

                key.SetValue(LatitudeProperty, latLong.Latitude);
                key.SetValue(LongitudeProperty, latLong.Longitude);

                key.Close();
            }
            catch (Exception ex)
            {
                if (Debugger.IsAttached)
                {
                    Debugger.Break();
                }

                // just re-throw for now
                // potentially catch specific exceptions for better handling
                throw ex;
            }
        }
Пример #3
0
        /// <summary>
        /// Write the <see cref="LatLong"/> to the Console.
        /// </summary>
        /// <param name="latLong">The <see cref="LatLong"/>.</param>
        public static void WriteLatLong(LatLong latLong)
        {
            if (latLong == null)
            {
                throw new ArgumentNullException(nameof(latLong));
            }

            Console.WriteLine("Lat:\t{0}", latLong.Latitude);
            Console.WriteLine("Long:\t{0}", latLong.Longitude);
        }