コード例 #1
0
 /// <exception cref="Exception">A delegate callback throws an exception.</exception>
 /// <exception cref="NotImplementedException">No Converter Implement.</exception>
 internal GPSCoordinate Convert(GPSCoordinate coordinate)
 {
     if (!m_converters.Any())
     {
         throw new NotImplementedException(string.Format("No Converter from {0} to {1}", From, To));
     }
     return(m_converters.Aggregate(coordinate, (current, converter) => converter(current)));
 }
コード例 #2
0
        /// <summary>
        /// 坐标系转换
        /// </summary>
        /// <param name="from"></param>
        /// <param name="to"></param>
        /// <param name="lng"></param>
        /// <param name="lat"></param>
        public static void Convert(PositionType from, PositionType to, ref double lng, ref double lat)
        {
            GPSCoordinate coordinate = new GPSCoordinate
            {
                Longitude = lng,
                Latitude  = lat
            };

            coordinate = _transferManager.Transfer(from, to, coordinate);
            lng        = coordinate.Longitude;
            lat        = coordinate.Latitude;
        }
コード例 #3
0
        /// <exception cref="Exception">A delegate callback throws an exception.</exception>
        internal GPSCoordinate Transfer(PositionType from, PositionType to, GPSCoordinate coordinate)
        {
            TypeTransfer transfer = SeekTransfer(from, to);

            return(transfer.Convert(coordinate));
        }