public static Rectangle Deserialize(BinaryReader br)
        {
            Point point = PointExtensions.Deserialize(br);
            Size  size  = SizeExtensions.Deserialize(br);

            return(new Rectangle(point, size));
        }
 public static byte[] Serialize(this Rectangle rectangle)
 {
     byte[] serialized = new byte[ByteArraySize];
     using (BinaryWriter bw = new BinaryWriter(new MemoryStream(serialized)))
     {
         bw.Write(PointExtensions.Serialize(rectangle.Location));
         bw.Write(SizeExtensions.Serialize(rectangle.Size));
     }
     return(serialized);
 }