/// <summary>
        /// Checks for equality
        /// </summary>
        /// <param name="obj"></param>
        /// <returns>True if ContainerContents are equal, false otherwise</returns>
        public override bool Equals(object obj)
        {
            if (obj == this)
            {
                return(true);
            }

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

            // If the object's type is not equal to this type
            if (GetType() != obj.GetType())
            {
                return(false);
            }

            try
            {
                // Try to cast
                IonContainerContent content = (IonContainerContent)obj;

                // Compare every value
                return(outlet.Equals(content.outlet) &&
                       type.Equals(content.type) &&
                       EqualsUtils.UnorderedEqual(children, content.children) &&
                       variation.Equals(content.variation));
            }

            catch
            {
                return(false);
            }
        }
        /// <summary>
        /// Check for equality
        /// </summary>
        /// <param name="obj"></param>
        /// <returns>true if equal and false otherwise</returns>
        public override bool Equals(object obj)
        {
            // Basic IonContent equality check
            if (!base.Equals(obj))
            {
                return(false);
            }

            try
            {
                // Try to cast to this type
                IonConnectionContent content = (IonConnectionContent)obj;

                return(connectionString.Equals(content.connectionString) &&
                       scheme.Equals(content.scheme) &&
                       collectionIdentifier.Equals(content.collectionIdentifier) &&
                       EqualsUtils.UnorderedEqual(pageIdentifierPath, content.pageIdentifierPath) &&
                       pageIdentifier.Equals(content.pageIdentifier) &&
                       contentIdentifier.Equals(content.contentIdentifier));
            }

            catch
            {
                return(false);
            }
        }
示例#3
0
        /// <summary>
        /// Checks for equality
        /// </summary>
        /// <param name="obj"></param>
        /// <returns>True if pages are equal, false otherwise</returns>
        public override bool Equals(object obj)
        {
            if (obj == this)
            {
                return(true);
            }

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

            // If the object's type is not equal to this type
            if (GetType() != obj.GetType())
            {
                return(false);
            }

            try
            {
                // Try to cast
                IonPage page = (IonPage)obj;

                // Compare each value
                return(parent.Equals(page.parent) &&
                       identifier.Equals(page.identifier) &&
                       collection.Equals(page.collection) &&
                       last_changed == page.last_changed &&
                       archive.Equals(page.archive) &&
                       EqualsUtils.UnorderedEqual(contents, page.contents) &&
                       EqualsUtils.UnorderedEqual(children, page.children) &&
                       locale.Equals(page.locale) &&
                       layout.Equals(page.layout) &&
                       position == page.position);
            }

            catch
            {
                return(false);
            }
        }
示例#4
0
        /// <summary>
        /// Checks a given collection's property for equality with this collection
        /// </summary>
        /// <param name="obj"></param>
        /// <returns>True if collections are equal, false otherwise</returns>
        public override bool Equals(object obj)
        {
            // If the object is the exact this object
            if (obj == this)
            {
                return(true);
            }

            // If the given object is null then it can't be equal too
            if (obj == null)
            {
                return(false);
            }

            // If the object's type is not equal to this type
            if (GetType() != obj.GetType())
            {
                return(false);
            }

            try
            {
                // Try to cast the object
                IonCollection content = (IonCollection)obj;

                // Check all elements for equality
                return(identifier.Equals(content.identifier) &&
                       default_locale.Equals(content.default_locale) &&
                       last_changed == content.last_changed &&
                       fts_db.Equals(content.fts_db) &&
                       archive.Equals(content.archive) &&
                       EqualsUtils.UnorderedEqual(pages, content.pages));
            }

            catch
            {
                return(false);
            }
        }
 /// <summary>
 /// Returns the hascode computed by its elements
 /// </summary>
 /// <returns>HashCode</returns>
 public override int GetHashCode()
 {
     return(EqualsUtils.calcHashCode(outlet, enabled, type));
 }
示例#6
0
 /// <summary>
 /// Calculates the hashCode for this pagePreview based on his identifier
 /// </summary>
 /// <returns>HashCode</returns>
 public override int GetHashCode()
 {
     return(EqualsUtils.calcHashCode(identifier, collection_identifier, locale));
 }
示例#7
0
 /// <summary>
 /// Returns the hascode computed by its elements
 /// </summary>
 /// <returns>HashCode</returns>
 public override int GetHashCode()
 {
     return(EqualsUtils.calcHashCode(text, outlet, type));
 }
示例#8
0
 /// <summary>
 /// Returns the hashCode calculated for the elements values
 /// </summary>
 /// <returns>HashCode</returns>
 public override int GetHashCode()
 {
     return(EqualsUtils.calcHashCode(r * a, g * a, b * a));
 }
 /// <summary>
 /// Returns the hascode computed by its elements
 /// </summary>
 /// <returns>HashCode</returns>
 public override int GetHashCode()
 {
     return(EqualsUtils.calcHashCode(outlet, type, imageURL));
 }
示例#10
0
 /// <summary>
 /// Calculates the hashCode of this collection by its unique identifier
 /// </summary>
 /// <returns>HashCode</returns>
 public override int GetHashCode()
 {
     return(EqualsUtils.calcHashCode(identifier, default_locale));
 }
示例#11
0
 /// <summary>
 /// Returns the hashCode calculated for the elements values
 /// </summary>
 /// <returns>HashCode</returns>
 public override int GetHashCode()
 {
     return(EqualsUtils.calcHashCode(svgData, chartData, chartConfig));
 }
 /// <summary>
 /// Returns the hashCode for this connectionContent
 /// </summary>
 /// <returns>HashCode</returns>
 public override int GetHashCode()
 {
     return(EqualsUtils.calcHashCode(connectionString, outlet, type));
 }