示例#1
0
        /// <summary>
        /// Compare two instances
        /// </summary>
        /// <param name="obj">
        /// A <see cref="object" />
        /// </param>
        /// <returns>
        /// A <see cref="bool" />
        /// </returns>
        public override bool Equals(object obj)
        {
            // Check for null values and compare run-time types.
            if ((obj == null) || (GetType() != obj.GetType()))
            {
                return(false);
            }


            var wol = (WakeOnLanPacket)obj;

            return(DestinationAddress.Equals(wol.DestinationAddress));
        }
示例#2
0
        public override bool Equals(object obj)
        {
            if (obj == this)
            {
                return(true);
            }

            var o = obj as SocketTuple;

            if (o == null)
            {
                return(false);
            }

            return
                (Type == o.Type &&
                 SourceAddress.Equals(o.SourceAddress) &&
                 DestinationAddress.Equals(o.DestinationAddress) &&
                 SourcePort == o.SourcePort &&
                 DestinationPort == o.DestinationPort);
        }