1
0
Fork 0

Bigfux: Ignore extra computed properties when serialising Rectangles.

This commit is contained in:
Starbeamrainbowlabs 2017-02-05 15:11:04 +00:00
parent e71ff31ef2
commit e36cc6578a
1 changed files with 9 additions and 0 deletions

View File

@ -1,5 +1,6 @@
using System; using System;
using System.Drawing; using System.Drawing;
using Newtonsoft.Json;
namespace SBRL.Utilities namespace SBRL.Utilities
{ {
@ -37,6 +38,7 @@ namespace SBRL.Utilities
/// <summary> /// <summary>
/// The top-left corner of the rectangle. /// The top-left corner of the rectangle.
/// </summary> /// </summary>
[JsonIgnore]
public Point TopLeft { public Point TopLeft {
get { get {
return new Point(X, Y); return new Point(X, Y);
@ -45,6 +47,7 @@ namespace SBRL.Utilities
/// <summary> /// <summary>
/// The top-right corner of the rectangle. /// The top-right corner of the rectangle.
/// </summary> /// </summary>
[JsonIgnore]
public Point TopRight { public Point TopRight {
get { get {
return new Point(X + Width, Y); return new Point(X + Width, Y);
@ -53,6 +56,7 @@ namespace SBRL.Utilities
/// <summary> /// <summary>
/// The bottom-left corner of the rectangle. /// The bottom-left corner of the rectangle.
/// </summary> /// </summary>
[JsonIgnore]
public Point BottomLeft { public Point BottomLeft {
get { get {
return new Point(X, Y + Height); return new Point(X, Y + Height);
@ -61,6 +65,7 @@ namespace SBRL.Utilities
/// <summary> /// <summary>
/// The bottom-right corner of the rectangle. /// The bottom-right corner of the rectangle.
/// </summary> /// </summary>
[JsonIgnore]
public Point BottomRight { public Point BottomRight {
get { get {
return new Point(X + Width, Y + Height); return new Point(X + Width, Y + Height);
@ -72,6 +77,7 @@ namespace SBRL.Utilities
/// <summary> /// <summary>
/// The Y coordinate of the top of the rectangle. /// The Y coordinate of the top of the rectangle.
/// </summary> /// </summary>
[JsonIgnore]
public int Top { public int Top {
get { get {
return Y; return Y;
@ -80,6 +86,7 @@ namespace SBRL.Utilities
/// <summary> /// <summary>
/// The Y coordinate of the bottom of the rectangle. /// The Y coordinate of the bottom of the rectangle.
/// </summary> /// </summary>
[JsonIgnore]
public int Bottom { public int Bottom {
get { get {
return Y + Width; return Y + Width;
@ -88,6 +95,7 @@ namespace SBRL.Utilities
/// <summary> /// <summary>
/// The X coordinate of the left side of the rectangle. /// The X coordinate of the left side of the rectangle.
/// </summary> /// </summary>
[JsonIgnore]
public int Left { public int Left {
get { get {
return X; return X;
@ -96,6 +104,7 @@ namespace SBRL.Utilities
/// <summary> /// <summary>
/// The X coordinate of the right side of the rectangle. /// The X coordinate of the right side of the rectangle.
/// </summary> /// </summary>
[JsonIgnore]
public int Right { public int Right {
get { get {
return X + Width; return X + Width;