Class Point
A point (x and y coordinates).
Inheritance
Namespace: FM.LiveSwitch
Assembly: FM.LiveSwitch.dll
Syntax
public class Point : object
Constructors
Point()
Initializes a new instance of the Point class.
Declaration
public Point()
Point(Int32, Int32)
Initializes a new instance of the Point class.
Declaration
public Point(int x, int y)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | x | The X coordinate. |
System.Int32 | y | The Y coordinate. |
Properties
Empty
Gets the empty point (0,0).
Declaration
public static Point Empty { get; }
Property Value
Type | Description |
---|---|
Point |
X
Gets or sets the X coordinate.
Declaration
public int X { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
Y
Gets or sets the Y coordinate.
Declaration
public int Y { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
Methods
Equals(Point)
Determines whether the specified point is equivalent to the current point. Does not require the object pointers to match.
Declaration
public bool Equals(Point point)
Parameters
Type | Name | Description |
---|---|---|
Point | point | The point to compare with the current object. |
Returns
Type | Description |
---|---|
System.Boolean | true if the specified point is equivalent to the current point; otherwise, false. |
Equals(Object)
Determines whether the specified object is equivalent to the current point. Does not require the object pointers to match.
Declaration
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
System.Object | obj | The object to compare with the current object. |
Returns
Type | Description |
---|---|
System.Boolean | true if the specified object is equivalent to the current object; otherwise, false. |
FromJson(String)
Deserializes an instance from JSON.
Declaration
public static Point FromJson(string pointJson)
Parameters
Type | Name | Description |
---|---|---|
System.String | pointJson | The JSON to deserialize. |
Returns
Type | Description |
---|---|
Point | The deserialized point. |
FromStruct(System.Drawing.Point)
Converts a System.Drawing.Point to a Point.
Declaration
public static Point FromStruct(System.Drawing.Point point)
Parameters
Type | Name | Description |
---|---|---|
System.Drawing.Point | point |
Returns
Type | Description |
---|---|
Point |
GetHashCode()
Gets a hash code for this instance.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
System.Int32 | A hash code. |
IsEquivalent(Point)
Determines whether the specified point is equivalent.
Declaration
public bool IsEquivalent(Point point)
Parameters
Type | Name | Description |
---|---|---|
Point | point | The point. |
Returns
Type | Description |
---|---|
System.Boolean |
IsEquivalent(Point, Point)
Determines whether the two points are equivalent.
Declaration
public static bool IsEquivalent(Point point1, Point point2)
Parameters
Type | Name | Description |
---|---|---|
Point | point1 | The first point. |
Point | point2 | The second point. |
Returns
Type | Description |
---|---|
System.Boolean |
ToJson()
Serializes this instance to JSON.
Declaration
public string ToJson()
Returns
Type | Description |
---|---|
System.String | The serialized JSON. |
ToJson(Point)
Serializes an instance to JSON.
Declaration
public static string ToJson(Point point)
Parameters
Type | Name | Description |
---|---|---|
Point | point | The point. |
Returns
Type | Description |
---|---|
System.String | The serialized JSON. |
ToString()
Returns a string that represents this instance using format "{x},{y}".
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
System.String |
ToStruct()
Converts this Point to a System.Drawing.Point.
Declaration
public System.Drawing.Point ToStruct()
Returns
Type | Description |
---|---|
System.Drawing.Point |
ToStruct(Point)
Converts a Point to a System.Drawing.Point.
Declaration
public static System.Drawing.Point ToStruct(Point point)
Parameters
Type | Name | Description |
---|---|---|
Point | point |
Returns
Type | Description |
---|---|
System.Drawing.Point |
Operators
Equality(Point, Point)
Determines whether the specified point is equivalent to the current point. Does not require the object pointers to match.
Declaration
public static bool operator ==(Point point1, Point point2)
Parameters
Type | Name | Description |
---|---|---|
Point | point1 | The first point. |
Point | point2 | The second point. |
Returns
Type | Description |
---|---|
System.Boolean | true if the specified point is equivalent to the current point; otherwise, false. |
Inequality(Point, Point)
Determines whether the specified point is NOT equivalent to the current point.
Declaration
public static bool operator !=(Point point1, Point point2)
Parameters
Type | Name | Description |
---|---|---|
Point | point1 | The first point. |
Point | point2 | The second point. |
Returns
Type | Description |
---|---|
System.Boolean | true if the specified point is NOT equivalent to the current point; otherwise, false. |