//
// UniWebViewEdgeInsets.cs
// Created by Wang Wei(@onevcat) on 2013-10-20.
//
[System.Serializable]
///
/// This class defined the edge inset of a UniWebView
///
public class UniWebViewEdgeInsets {
public int top, left, bottom, right;
///
/// Initializes a new instance of the class.
///
/// Top inset by point.
/// Left inset by point.
/// Bottominset by point.
/// Rightinset by point.
public UniWebViewEdgeInsets(int aTop, int aLeft, int aBottom, int aRight) {
top = aTop;
left = aLeft;
bottom = aBottom;
right = aRight;
}
public static bool operator ==(UniWebViewEdgeInsets inset1, UniWebViewEdgeInsets inset2)
{
return inset1.Equals(inset2);
}
public static bool operator !=(UniWebViewEdgeInsets inset1, UniWebViewEdgeInsets inset2)
{
return !inset1.Equals(inset2);
}
public override int GetHashCode()
{
var calculation = top + left + bottom + right;
return calculation.GetHashCode();
}
public override bool Equals (object obj)
{
if (obj == null || GetType() != obj.GetType()) {
return false;
}
UniWebViewEdgeInsets anInset = (UniWebViewEdgeInsets)obj;
return (top == anInset.top) &&
(left == anInset.left) &&
(bottom == anInset.bottom) &&
(right == anInset.right);
}
}