Esempio n. 1
0
        /// <summary>
        /// Determines whether the specified element is equal.
        /// </summary>
        /// <param name="day">The element.</param>
        /// <returns>
        /// <c>
        /// true
        /// </c>
        /// if the specified element is equal; otherwise,
        /// <c>
        /// false
        /// </c>
        /// .
        /// </returns>
        public bool IsEqual(ITime day)
        {
            if (day != null &&
                day != Default)
            {
                try
                {
                    if (day?.GetValue()?.Equals(Day) == true &&
                        day?.GetName() == Name)
                    {
                        return(true);
                    }
                }
                catch (Exception ex)
                {
                    Fail(ex);
                    return(false);
                }
            }

            return(false);
        }
Esempio n. 2
0
        /// <summary>
        /// Determines whether the specified primary is equal.
        /// </summary>
        /// <param name="first">The primary.</param>
        /// <param name="second">The secondary.</param>
        /// <returns>
        /// <c>
        /// true
        /// </c>
        /// if the specified primary is equal; otherwise,
        /// <c>
        /// false
        /// </c>
        /// .
        /// </returns>
        public static bool IsEqual(ITime first, ITime second)
        {
            if (first != null &&
                first != Element.Default &&
                first != null &&
                second != Element.Default)
            {
                try
                {
                    if (first?.GetValue()?.Equals(second?.GetValue()) == true &&
                        first?.GetName() == second?.GetName())
                    {
                        return(true);
                    }
                }
                catch (Exception ex)
                {
                    Fail(ex);
                    return(false);
                }
            }

            return(false);
        }