public bool Equals(ImageSize p) { // If parameter is null return false: if ((object)p == null) { return false; } // Return true if the fields match: return (this.width == p.width) && (this.height == p.height); }