/// <summary>
        /// Converts the string representation of a <see cref="Point2F"/> to an object instance.
        /// A return value indicates whether the conversion succeeded.
        /// </summary>
        /// <param name="s">The string to convert.</param>
        /// <param name="style">A set of <see cref="NumberStyles"/> values indicating which elements are present in <paramref name="s"/>.</param>
        /// <param name="provider">A format provider that provides culture-specific formatting information.</param>
        /// <param name="v">The converted value.</param>
        /// <returns><see langword="true"/> if the conversion succeeded; otherwise, <see langword="false"/>.</returns>
        public static Boolean TryParse(String s, NumberStyles style, IFormatProvider provider, out Point2F v)
        {
            v = default(Point2F);

            if (String.IsNullOrEmpty(s))
            {
                return(false);
            }

            var components = s.Split((Char[])null, StringSplitOptions.RemoveEmptyEntries);

            if (components.Length != 2)
            {
                return(false);
            }

            Single x, y;

            if (!Single.TryParse(components[0], style, provider, out x))
            {
                return(false);
            }
            if (!Single.TryParse(components[1], style, provider, out y))
            {
                return(false);
            }

            v = new Point2F(x, y);
            return(true);
        }
 /// <inheritdoc/>
 public Boolean Equals(Point2F other)
 {
     return
         (this.X == other.X &&
          this.Y == other.Y);
 }
 /// <summary>
 /// Converts the string representation of a <see cref="Point2F"/> to an object instance.
 /// A return value indicates whether the conversion succeeded.
 /// </summary>
 /// <param name="s">The string to convert.</param>
 /// <param name="v">The converted value.</param>
 /// <returns><see langword="true"/> if the conversion succeeded; otherwise, <see langword="false"/>.</returns>
 public static Boolean TryParse(String s, out Point2F v)
 {
     return(TryParse(s, NumberStyles.Number, NumberFormatInfo.CurrentInfo, out v));
 }
Exemplo n.º 4
0
 /// <summary>
 /// Gets a value indicating whether the rectangle contains the specified point.
 /// </summary>
 /// <param name="point">The point to evaluate.</param>
 /// <returns><see langword="true"/> if the rectangle contains the specified point; otherwise, <see langword="false"/>.</returns>
 public Boolean Contains(Point2F point)
 {
     return
         (point.X >= this.X && point.X < this.X + this.Width &&
          point.Y >= this.Y && point.Y < this.Y + this.Height);
 }
Exemplo n.º 5
0
 /// <summary>
 /// Gets a value indicating whether the rectangle contains the specified point.
 /// </summary>
 /// <param name="point">The point to evaluate.</param>
 /// <param name="result">A value indicating whether the rectangle contains the specified point.</param>
 public void Contains(ref Point2F point, out Boolean result)
 {
     result =
         point.X >= this.X && point.X < this.X + this.Width &&
         point.Y >= this.Y && point.Y < this.Y + this.Height;
 }
Exemplo n.º 6
0
 /// <summary>
 /// Initializes a new instance of the <see cref="RectangleF"/> class.
 /// </summary>
 /// <param name="position">The rectangle's position.</param>
 /// <param name="size">The rectangle's size.</param>
 public RectangleF(Point2F position, Size2F size)
     : this(position.X, position.Y, size.Width, size.Height)
 {
 }
Exemplo n.º 7
0
 /// <summary>
 /// Initializes a new instance of the <see cref="CircleF"/> structure.
 /// </summary>
 /// <param name="position">The position of the circle's center.</param>
 /// <param name="radius">The circle's radius.</param>
 public CircleF(Point2F position, Single radius)
     : this(position.X, position.Y, radius)
 {
 }