mirror of
https://github.com/ElectronNET/Electron.NET.git
synced 2026-02-14 05:34:48 +00:00
Merge pull request #801 from ds5678/primitive-implicit-conversions
Implicit Conversions to System.Drawing structs
This commit is contained in:
@@ -20,5 +20,14 @@
|
||||
/// The y.
|
||||
/// </value>
|
||||
public int Y { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Convert this <see cref="Point"/> to <see cref="System.Drawing.Point"/>.
|
||||
/// </summary>
|
||||
/// <param name="point">The point.</param>
|
||||
public static implicit operator System.Drawing.Point(Point point)
|
||||
{
|
||||
return new System.Drawing.Point(point.X, point.Y);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -36,5 +36,14 @@
|
||||
/// The height.
|
||||
/// </value>
|
||||
public int Height { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Convert this <see cref="Rectangle"/> to <see cref="System.Drawing.Rectangle"/>.
|
||||
/// </summary>
|
||||
/// <param name="rectangle">The rectangle.</param>
|
||||
public static implicit operator System.Drawing.Rectangle(Rectangle rectangle)
|
||||
{
|
||||
return new System.Drawing.Rectangle(rectangle.X, rectangle.Y, rectangle.Width, rectangle.Height);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -20,5 +20,14 @@
|
||||
/// The height.
|
||||
/// </value>
|
||||
public int Height { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Convert this <see cref="Size"/> to <see cref="System.Drawing.Size"/>.
|
||||
/// </summary>
|
||||
/// <param name="size">The size.</param>
|
||||
public static implicit operator System.Drawing.Size(Size size)
|
||||
{
|
||||
return new System.Drawing.Size(size.Width, size.Height);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user