Ejemplo n.º 1
0
        internal override int GetRecurciveHashCode(ReferenceHashSet <Content> visitedContents)
        {
            int hash = base.GetHashCode();

            hash = HashHelper.CombineHashCodes(hash, PreloadingMode.GetHashCode());

            if (RelationCondition != null)
            {
                hash = HashHelper.CombineHashCodes(hash, RelationCondition.GetHashCode());
            }
            if (ClonePrototypeCondition != null)
            {
                hash = HashHelper.CombineHashCodes(hash, ClonePrototypeCondition.GetHashCode());
            }
            if (Content != null)
            {
                hash = HashHelper.CombineHashCodes(hash, Content.GetRecurciveHashCode(visitedContents));
            }
            if (CloneDefinition != null)
            {
                hash = HashHelper.CombineHashCodes(hash, CloneDefinition.GetRecurciveHashCode(visitedContents));
            }

            return(hash);
        }
Ejemplo n.º 2
0
        internal override int GetRecurciveHashCode(ReferenceHashSet <Content> visitedContents)
        {
            int hash = base.GetHashCode();

            foreach (Content content in ContentMapping.Values.OrderBy(x => x.ContentId))
            {
                int contentHash = content.GetRecurciveHashCode(visitedContents);
                hash = HashHelper.CombineHashCodes(hash, contentHash);
            }

            return(hash);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// хеш код по всей глубине контена с учетом того что могут быть циклы
        /// </summary>
        /// <param name="visitedContents">родительские контенты</param>
        internal int GetRecurciveHashCode(ReferenceHashSet <Content> visitedContents)
        {
            if (visitedContents.Contains(this))
            {
                return(HashHelper.CombineHashCodes(ContentId.GetHashCode(), visitedContents.Count.GetHashCode()));
            }

            visitedContents.Add(this);

            int hash = PublishingMode.GetHashCode();

            hash = HashHelper.CombineHashCodes(hash, IsReadOnly.GetHashCode());
            hash = HashHelper.CombineHashCodes(hash, LoadAllPlainFields.GetHashCode());
            hash = HashHelper.CombineHashCodes(hash, ContentId.GetHashCode());

            foreach (Field field in Fields.OrderBy(x => x.FieldId))
            {
                int fieldHash = field.GetRecurciveHashCode(visitedContents);
                hash = HashHelper.CombineHashCodes(hash, fieldHash);
            }

            return(hash);
        }
Ejemplo n.º 4
0
 internal virtual int GetRecurciveHashCode(ReferenceHashSet <Content> visitedContents)
 {
     return(GetHashCode());
 }