public static RectangleJSON FromRectangle(Rectangle rect) { RectangleJSON jsonRect = new RectangleJSON(); jsonRect.X = rect.X; jsonRect.Y = rect.Y; jsonRect.Width = rect.Width; jsonRect.Height = rect.Height; return(jsonRect); }
public static Rectangle ToRectangle(RectangleJSON jsonRect) { Rectangle rect = new Rectangle(); rect.X = jsonRect.X; rect.Y = jsonRect.Y; rect.Width = jsonRect.Width; rect.Height = jsonRect.Height; return(rect); }