public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            ZonePoint zp = value as ZonePoint;
            if (zp == null)
            {
                if (!(parameter is string) || (string)parameter != "NoNull")
                {
                    return null;
                }
                else
                {
                    zp = new ZonePoint(0, 0, 0);
                }
            } 

            return zp.ToGeoCoordinate();
        }
コード例 #2
0
ファイル: CoordBounds.cs プロジェクト: chier01/WF.Player.Core
 /// <summary>
 /// Constructs a CoordBounds that is the minimum bounding box
 /// of two ZonePoints.
 /// </summary>
 /// <param name="zp1"></param>
 /// <param name="zp2"></param>
 public CoordBounds(ZonePoint zp1, ZonePoint zp2)
     : this(zp1.Longitude, zp1.Latitude, zp2.Longitude, zp2.Latitude)
 {
 }
コード例 #3
0
ファイル: CoordBounds.cs プロジェクト: chier01/WF.Player.Core
 /// <summary>
 /// Enlarges these bounds so that a ZonePoint can fit inside.
 /// </summary>
 /// <param name="zp"></param>
 public void Inflate(ZonePoint zp)
 {
     Inflate(zp.Latitude, zp.Longitude);
 }
コード例 #4
0
ファイル: CoordBounds.cs プロジェクト: chier01/WF.Player.Core
 /// <summary>
 /// Constructs a CoordBounds that is completely enclosing
 /// a single ZonePoint.
 /// </summary>
 /// <param name="zp"></param>
 public CoordBounds(ZonePoint zp)
     : this(zp, zp)
 {
 }
コード例 #5
0
		/// <summary>
		/// Initializes a new instance of the <see cref="WF.Player.CartridgeDetailViewModel"/> class.
		/// </summary>
		/// <param name="tag">CartridgeTag to show.</param>
		public CartridgeDetailViewModel(CartridgeTag tag)
		{
			this.cartridgeTag = tag;

			this.geoMathHelper = new GeoMathHelper();
			this.target = new ZonePoint(cartridgeTag.Cartridge.StartingLocationLatitude, cartridgeTag.Cartridge.StartingLocationLongitude, 0);

			Direction = double.NegativeInfinity;
			Distance = double.NegativeInfinity;

			if (App.GPS.LastKnownPosition != null)
			{
				HandlePositionChanged(this, new PositionEventArgs(App.GPS.LastKnownPosition));
			}
		}
コード例 #6
0
ファイル: ZonePoint.cs プロジェクト: chier01/WF.Player.Core
 /// <summary>
 /// Gets the location vector between this point and another one.
 /// </summary>
 /// <param name="zp">Target (end point of the vector).</param>
 /// <returns>A location vector whose start is this point and whose end is <paramref name="zp"/>.</returns>
 public LocationVector GetVectorTo(ZonePoint zp)
 {
     return new Utils.GeoMathHelper().VectorToPoint(this, zp);
 }
コード例 #7
0
ファイル: ExtendedMap.cs プロジェクト: Surfoo/WF.Player
			public MapPoint(ZonePoint point, string name)
			{
				Point = point;
				Name = name;
			}
コード例 #8
0
ファイル: CoordBounds.cs プロジェクト: chier01/WF.Player.Core
 /// <summary>
 /// Constructs a CoordBounds that is the minimum bounding box
 /// of two ZonePoints.
 /// </summary>
 /// <param name="zp1"></param>
 /// <param name="zp2"></param>
 public CoordBounds(ZonePoint zp1, ZonePoint zp2)
     : this(zp1.Longitude, zp1.Latitude, zp2.Longitude, zp2.Latitude)
 {
 }
コード例 #9
0
ファイル: CoordBounds.cs プロジェクト: chier01/WF.Player.Core
        /// <summary>
        /// Enlarges these bounds so that a ZonePoint can fit inside.
        /// </summary>
        /// <param name="zp"></param>
        public void Inflate(ZonePoint zp)
		{
            Inflate(zp.Latitude, zp.Longitude);
		}
コード例 #10
0
ファイル: CoordBounds.cs プロジェクト: chier01/WF.Player.Core
 /// <summary>
 /// Constructs a CoordBounds that is completely enclosing
 /// a single ZonePoint.
 /// </summary>
 /// <param name="zp"></param>
 public CoordBounds(ZonePoint zp)
     : this(zp, zp)
 {
 }
コード例 #11
0
 /// <summary>
 /// Gets the location vector between this point and another one.
 /// </summary>
 /// <param name="zp">Target (end point of the vector).</param>
 /// <returns>A location vector whose start is this point and whose end is <paramref name="zp"/>.</returns>
 public LocationVector GetVectorTo(ZonePoint zp)
 {
     return(new Utils.GeoMathHelper().VectorToPoint(this, zp));
 }