コード例 #1
0
ファイル: DataRegion.cs プロジェクト: a-leggett/Storage
        /// <summary>
        /// Gets the hash code of this <see cref="DataRegion"/>.
        /// </summary>
        /// <returns>The hash code.</returns>
        public override int GetHashCode()
        {
            int ret = 14741;

            ret = ret * 727 + FirstIndex.GetHashCode();
            ret = ret * 727 + LastIndex.GetHashCode();
            return(ret);
        }
コード例 #2
0
        public string NextDimValue()
        {
            if (string.IsNullOrEmpty(DimensionPrefix))
            {
                return("");
            }
            string dimVal = DimensionPrefix;

            this.LastIndex += 1;
            dimVal          = dimVal + LastIndex.ToString().PadLeft((9 - this.DimensionPrefix.Length), '0');
            return(dimVal);
        }
コード例 #3
0
        public override int GetHashCode()
        {
            var hashCode = -1959644465;

            hashCode = hashCode * -1521134295 + XFields?.Count.GetHashCode() ?? 0;
            hashCode = hashCode * -1521134295 + XFields?.Select(field => field.GetHashCode()).Aggregate(0, (acc, val) => acc ^ val) ?? 0;
            hashCode = hashCode * -1521134295 + YFields?.Count.GetHashCode() ?? 0;
            hashCode = hashCode * -1521134295 + YFields?.Select(field => field.GetHashCode()).Aggregate(0, (acc, val) => acc ^ val) ?? 0;
            hashCode = hashCode * -1521134295 + Grouping?.GetHashCode() ?? 0;
            hashCode = hashCode * -1521134295 + CType.GetHashCode();
            hashCode = hashCode * -1521134295 + Orientation.GetHashCode();
            hashCode = hashCode * -1521134295 + FirstIndex.GetHashCode();
            hashCode = hashCode * -1521134295 + LastIndex.GetHashCode();
            return(hashCode);
        }