using System.Globalization; namespace ScreenConnect; public struct CoreSize { public int Width { get; set; } public int Height { get; set; } public CoreSize(int width, int height) { this = default(CoreSize); Width = width; Height = height; } public static bool operator ==(CoreSize sz1, CoreSize sz2) { if (sz1.Width == sz2.Width) { return sz1.Height == sz2.Height; } return false; } public static bool operator !=(CoreSize sz1, CoreSize sz2) { return !(sz1 == sz2); } public static CoreSize operator *(CoreSize size, float scale) { return new CoreSize((int)((float)size.Width * scale), (int)((float)size.Height * scale)); } public override bool Equals(object obj) { if (!(obj is CoreSize coreSize)) { return false; } if (coreSize.Width == Width) { return coreSize.Height == Height; } return false; } public override int GetHashCode() { return HashCode.Seed.And(Width).And(Height); } public override string ToString() { return "{Width=" + Width.ToString(CultureInfo.CurrentCulture) + ", Height=" + Height.ToString(CultureInfo.CurrentCulture) + "}"; } }