示例#1
0
        /// <summary>
        /// Determines if this object is by value equal to another.
        /// </summary>
        /// <param name="obj">A object to compare with.</param>
        /// <returns>If the two objects are considered equal, true. False otherwise</returns>
        public override bool Equals(object obj)
        {
            if (obj == null)
            {
                return(false);
            }

            // If parameter cannot be cast to Point return false.
            EriverProtocol other = obj as EriverProtocol;

            if ((System.Object)other == null)
            {
                return(false);
            }

            if (this.Kind != other.Kind)
            {
                return(false);
            }

            switch (Kind)
            {
            case Command.GetPoint: return(GetPoint.Equals(other.GetPoint));

            case Command.StartCalibration: return(StartCalibration.Equals(other.StartCalibration));

            case Command.EndCalibration: return(true);

            case Command.ClearCalibration: return(true);

            case Command.AddPoint: return(AddPoint.Equals(other.AddPoint));

            case Command.Unavailable: return(true);

            case Command.Name: return(Name.Equals(other.Name));

            case Command.Fps: return(Fps.Equals(other.Fps));

            case Command.KeepAlive: return(true);

            default: return(false);
            }
        }