PurplePen.DescriptionCourseObj.Equals C# (CSharp) Method

Equals() public method

public Equals ( object obj ) : bool
obj object
return bool
        public override bool Equals(object obj)
        {
            if (obj == null || GetType() != obj.GetType()) {
                return false;
            }

            DescriptionCourseObj other = (DescriptionCourseObj) obj;

            // Check description kind
            if (renderer.DescriptionKind != other.renderer.DescriptionKind)
                return false;
            if (renderer.NumberOfColumns != other.renderer.NumberOfColumns)
                return false;

            // Check description
            DescriptionLine[] myDesc = renderer.Description;
            DescriptionLine[] otherDesc = other.renderer.Description;
            if (myDesc.Length != otherDesc.Length)
                return false;
            for (int i = 0; i < myDesc.Length; ++i) {
                if (! myDesc[i].Equals(otherDesc[i]))
                    return false;
            }

            // Check id and bounding rect.
            return base.Equals(obj);
        }