예제 #1
0
        public override bool Equals(object obj)
        {
            SinglePageAssemblyInstruction target = obj as SinglePageAssemblyInstruction;

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

            if (
                (PageMetadata != null && target.PageMetadata == null) ||
                (PageMetadata == null && target.PageMetadata != null)
                )
            {
                return(false);
            }

            if (PageMetadata != null && target.PageMetadata != null)
            {
                if (!PageMetadata.Equals(target.PageMetadata))
                {
                    return(false);
                }
            }


            if (
                (_snippets != null && target._snippets == null) ||
                (_snippets == null && target._snippets != null)
                )
            {
                return(false);
            }

            if (_snippets != null && target._snippets != null)
            {
                if (!_snippets.Equals(target._snippets))
                {
                    return(false);
                }
            }

            return(true);
        }
예제 #2
0
        /// <summary>
        /// Determines whether the specified <see cref="T:System.Object"/> is equal to the current <see cref="T:System.Object"/>.
        /// </summary>
        /// <param name="obj">The <see cref="T:System.Object"/> to compare with the current <see cref="T:System.Object"/>.</param>
        /// <returns>
        /// true if the specified <see cref="T:System.Object"/> is equal to the current <see cref="T:System.Object"/>; otherwise, false.
        /// </returns>
        /// <exception cref="T:System.NullReferenceException">
        /// The <paramref name="obj"/> parameter is null.
        /// </exception>
        public override bool Equals(object obj)
        {
            GenericFileInstruction target = obj as GenericFileInstruction;

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

            if (PrettyUrl != target.PrettyUrl)
            {
                return(false);
            }

            if (FilePath != target.FilePath)
            {
                return(false);
            }

            if (Language != target.Language)
            {
                return(false);
            }

            if (SectionPath != target.SectionPath)
            {
                return(false);
            }

            if (
                (PageMetadata != null && target.PageMetadata == null) ||
                (PageMetadata == null && target.PageMetadata != null)
                )
            {
                return(false);
            }

            if (PageMetadata != null && target.PageMetadata != null)
            {
                if (!PageMetadata.Equals(target.PageMetadata))
                {
                    return(false);
                }
            }

            if (
                (ContentDates != null && target.ContentDates == null) ||
                (ContentDates == null && target.ContentDates != null)
                )
            {
                return(false);
            }

            if (ContentDates != null && target.ContentDates != null)
            {
                if (!ContentDates.Equals(target.ContentDates))
                {
                    return(false);
                }
            }


            return(true);
        }