예제 #1
0
        /// <summary>
        /// Equals
        /// </summary>
        /// <param name="o">The object should be compared.</param>
        /// <returns>True if equal.</returns>
        /// <since_tizen> 4 </since_tizen>
        public override bool Equals(object o)
        {
            if (o == null)
            {
                return(false);
            }
            if (!(o is PaddingType))
            {
                return(false);
            }
            PaddingType p = (PaddingType)o;

            // Return true if the fields match:
            return((System.Math.Abs(Start - p.Start) < NDalic.GetRangedEpsilon(Start, p.Start)) &&
                   (System.Math.Abs(End - p.End) < NDalic.GetRangedEpsilon(End, p.End)) &&
                   (System.Math.Abs(Bottom - p.Bottom) < NDalic.GetRangedEpsilon(Bottom, p.Bottom)) &&
                   (System.Math.Abs(Top - p.Top) < NDalic.GetRangedEpsilon(Top, p.Top)));
        }
예제 #2
0
        /// <summary>
        /// Equality operator.
        /// </summary>
        /// <param name="a">First operand</param>
        /// <param name="b">Second operand</param>
        /// <returns>True if the values are identical</returns>
        /// <since_tizen> 3 </since_tizen>
        public static bool operator ==(PaddingType a, PaddingType b)
        {
            // If both are null, or both are same instance, return true.
            if (System.Object.ReferenceEquals(a, b))
            {
                return(true);
            }

            // If one is null, but not both, return false.
            if (((object)a == null) || ((object)b == null))
            {
                return(false);
            }

            // Return true if the fields match:
            return((System.Math.Abs(a.Start - b.Start) < NDalic.GetRangedEpsilon(a.Start, b.Start)) &&
                   (System.Math.Abs(a.End - b.End) < NDalic.GetRangedEpsilon(a.End, b.End)) &&
                   (System.Math.Abs(a.Bottom - b.Bottom) < NDalic.GetRangedEpsilon(a.Bottom, b.Bottom)) &&
                   (System.Math.Abs(a.Top - b.Top) < NDalic.GetRangedEpsilon(a.Top, b.Top)));
        }