Ejemplo n.º 1
0
        public override int GetHashCode()
        {
            if (!hashCodeBuilded)
            {
                HashCodeBuilder builder = new HashCodeBuilder();

                //StructureType
                builder.Append(StructureType);

                //descriptor
                builder.Append(descriptor);

                //Items
                for (int i = 0; i < Path.Length; i++)
                {
                    builder.Append(Path[i]);
                }

                hashCode        = builder.GetHashCode();
                hashCodeBuilded = true;
            }

            return(hashCode);
        }
Ejemplo n.º 2
0
 protected override int GetHashCodeCore(HashCodeBuilder builder)
 {
     return(builder.GetHashCode());
 }
        public static void HashCode_GetHashCode()
        {
            var hc = new HashCodeBuilder();

            Assert.Throws <NotSupportedException>(() => hc.GetHashCode());
        }