using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace WMFConverter.Gdi
{
///
/// Represents a size object.
///
public class Size
{
#region Properties
///
/// Width of the object.
///
public int Width { get; set; }
///
/// Height of the object.
///
public int Height { get; set; }
#endregion
#region Constructors
///
/// Default constructor.
///
///
///
public Size(int width, int height)
{
Width = width;
Height = height;
}
#endregion
#region Public Methods
///
/// Serves as the default hash function.
///
///
public override int GetHashCode()
{
int prime = 31;
int result = 1;
result = prime * result + Height;
result = prime * result + Width;
return result;
}
///
/// Determines whether the specified object is equal to the current object.
///
///
///
public override bool Equals(Object obj)
{
if (this == obj)
return true;
if (obj == null)
return false;
if (typeof(Size) != obj.GetType())
return false;
Size other = (Size)obj;
if (Height != other.Height)
return false;
if (Width != other.Width)
return false;
return true;
}
///
/// Returns a string that represents the current object.
///
///
public override string ToString()
{
return "Size [width=" + Width + ", height=" + Height + "]";
}
#endregion
}
}