/* * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved * * Licensed under the Apache License, Version 2.0 (the License); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an AS IS BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ using System; namespace ElmSharp { /// /// The Size is a struct defining the height and width as a pair of generic type. /// /// preview [Obsolete("This has been deprecated in API12")] public struct Size : IEquatable { /// /// Magnitude along the horizontal axis, in platform-defined units. /// /// preview [Obsolete("This has been deprecated in API12")] public int Width; /// /// Magnitude along the vertical axis, in platform-specific units. /// /// preview [Obsolete("This has been deprecated in API12")] public int Height; /// /// Initializes a new instance of the size structure from specified dimensions. /// /// The width to set. /// The height to set. /// preview [Obsolete("This has been deprecated in API12")] public Size(int width, int height) { Width = width; Height = height; } /// /// A human-readable representation of . /// /// The string is formatted as "{{Width={0} Height={1}}}". /// preview [Obsolete("This has been deprecated in API12")] public override string ToString() { return string.Format("{{Width={0} Height={1}}}", Width, Height); } /// /// Gets the hash code. /// /// The hash code. /// preview [Obsolete("This has been deprecated in API12")] public override int GetHashCode() { unchecked { return Width.GetHashCode() ^ (Height.GetHashCode() * 397); } } /// /// Indicates whether this instance and a specified object are equal. /// /// The object to compare with the current instance. /// /// true if the object and this instance are of the same type and represent the same value, /// otherwise false. /// /// preview [Obsolete("This has been deprecated in API12")] public override bool Equals(object obj) { if (!(obj is Size)) return false; return Equals((Size)obj); } /// /// Indicates whether this instance and a object are equal. /// /// The to compare with the current instance. /// /// true if the object and this instance are of the same type and represent the same value, /// otherwise false. /// /// preview [Obsolete("This has been deprecated in API12")] public bool Equals(Size other) { return Width.Equals(other.Width) && Height.Equals(other.Height); } /// /// Whether both s are equal. /// /// A on the left hand side. /// A on the right hand side. /// True if both s have equal values. /// preview [Obsolete("This has been deprecated in API12")] public static bool operator ==(Size s1, Size s2) { return s1.Equals(s2); } /// /// Whether both s are not equal. /// /// A on the left hand side. /// A on the right hand side. /// True if both s do not have equal values. /// preview [Obsolete("This has been deprecated in API12")] public static bool operator !=(Size s1, Size s2) { return !s1.Equals(s2); } } }