Example #1
0
        /// <summary>
        /// Tests whether the specified object is a <see cref="LogitechLedId" /> and is equivalent to this <see cref="LogitechLedId" />.
        /// </summary>
        /// <param name="obj">The object to test.</param>
        /// <returns><c>true</c> if <paramref name="obj" /> is a <see cref="LogitechLedId" /> equivalent to this <see cref="LogitechLedId" />; otherwise, <c>false</c>.</returns>
        public override bool Equals(object obj)
        {
            LogitechLedId compareLedId = obj as LogitechLedId;

            if (ReferenceEquals(compareLedId, null))
            {
                return(false);
            }

            if (ReferenceEquals(this, compareLedId))
            {
                return(true);
            }

            if (GetType() != compareLedId.GetType())
            {
                return(false);
            }

            return(compareLedId.LedId == LedId);
        }