/// <summary></summary>
        public override int GetHashCode()
        {
            var code = 13;

            code = (code * 7) + Id.GetHashCode();
            if (ItemReference != null)
            {
                code = (code * 7) + ItemReference.GetHashCode();
            }
            if (Description != null)
            {
                code = (code * 7) + Description.GetHashCode();
            }
            code = (code * 7) + ChildrenCount.GetHashCode();
            if (Children != null)
            {
                var arrCode = 0;
                foreach (var item in Children)
                {
                    arrCode += item.GetHashCode();
                }
                code = (code * 7) + arrCode;
            }

            return(code);
        }
示例#2
0
        /// <summary></summary>
        public override int GetHashCode()
        {
            var code = 13;

            // Calculate hash on each properties one by one
            code = (code * 7) + Id.GetHashCode();
            if (ItemReference != null)
            {
                code = (code * 7) + ItemReference.GetHashCode();
            }
            if (this.AnnotationsUrl != null)
            {
                code = (code * 7) + AnnotationsUrl.GetHashCode();
            }
            if (this.CategoryUrl != null)
            {
                code = (code * 7) + CategoryUrl.GetHashCode();
            }
            if (this.CreationTime != null)
            {
                code = (code * 7) + CreationTime.GetHashCode();
            }
            code = (code * 7) + IsAckRequired.GetHashCode();
            code = (code * 7) + IsAcknowledged.GetHashCode();
            code = (code * 7) + IsDiscarded.GetHashCode();
            if (this.Message != null)
            {
                code = (code * 7) + Message.GetHashCode();
            }
            if (this.Name != null)
            {
                code = (code * 7) + Name.GetHashCode();
            }
            if (this.ObjectUrl != null)
            {
                code = (code * 7) + ObjectUrl.GetHashCode();
            }
            code = (code * 7) + Priority.GetHashCode();
            if (this.Self != null)
            {
                code = (code * 7) + Self.GetHashCode();
            }
            if (this.TypeUrl != null)
            {
                code = (code * 7) + TypeUrl.GetHashCode();
            }
            if (this.Type != null)
            {
                code = (code * 7) + Type.GetHashCode();
            }
            if (this.Category != null)
            {
                code = (code * 7) + Category.GetHashCode();
            }
            return(code);
        }