diff options
Diffstat (limited to 'Client/Assets/Scripts/UniWebView/Script/UniWebViewEdgeInsets.cs')
-rw-r--r-- | Client/Assets/Scripts/UniWebView/Script/UniWebViewEdgeInsets.cs | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/Client/Assets/Scripts/UniWebView/Script/UniWebViewEdgeInsets.cs b/Client/Assets/Scripts/UniWebView/Script/UniWebViewEdgeInsets.cs new file mode 100644 index 00000000..88cb8755 --- /dev/null +++ b/Client/Assets/Scripts/UniWebView/Script/UniWebViewEdgeInsets.cs @@ -0,0 +1,55 @@ +//
+// UniWebViewEdgeInsets.cs
+// Created by Wang Wei(@onevcat) on 2013-10-20.
+//
+
+[System.Serializable]
+/// <summary>
+/// This class defined the edge inset of a UniWebView
+/// </summary>
+public class UniWebViewEdgeInsets {
+
+ public int top, left, bottom, right;
+
+ /// <summary>
+ /// Initializes a new instance of the <see cref="UniWebViewEdgeInsets"/> class.
+ /// </summary>
+ /// <param name="aTop">Top inset by point.</param>
+ /// <param name="aLeft">Left inset by point.</param>
+ /// <param name="aBottom">Bottominset by point.</param>
+ /// <param name="aRight">Rightinset by point.</param>
+ 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);
+ }
+}
|