25 using System.Runtime.InteropServices;
26 using SiliconStudio.Core.Serialization;
28 namespace SiliconStudio.Core.Mathematics
33 [DataContract(
"!Size2")]
35 [StructLayout(LayoutKind.Sequential)]
36 public struct Size2 : IEquatable<Size2>
46 public static readonly
Size2 Empty = Zero;
53 public Size2(
int width,
int height)
80 return other.Width == Width && other.Height == Height;
84 public override bool Equals(
object obj)
86 if (ReferenceEquals(null, obj))
return false;
87 if (obj.GetType() != typeof(
Size2))
return false;
88 return Equals((
Size2)obj);
96 return (Width*397) ^ Height;
110 return left.Equals(right);
123 return !left.Equals(right);
128 return string.Format(
"({0},{1})", Width, Height);
bool Equals(Size2 other)
Determines whether the specified System.Object is equal to this instance.
override string ToString()
override int GetHashCode()
Size2(int width, int height)
Initializes a new instance of the Size2 struct.
Structure using the same layout than System.Drawing.Size.
override bool Equals(object obj)
DataStyle
Specifies the style used for textual serialization when an array/list or a dictionary/map must be ser...