Esempio n. 1
0
 /// <summary>
 /// Returns the hash code for this instance.
 /// </summary>
 /// <returns>A 32-bit signed integer that is the hash code for this instance.</returns>
 public override int GetHashCode()
 {
     return(HashHelper.Combine(
                Name.GetHashCode(),
                Format.GetHashCode(),
                Semantic.GetHashCode()));
 }
Esempio n. 2
0
        public VertexElement(int offset, VertexElementFormat format, string semantic)
        {
            if (string.IsNullOrEmpty(semantic))
            {
                throw new ArgumentException("semantic cannot be empty or null.");
            }
            int num = semantic.Length;

            while (num > 0 && char.IsDigit(semantic[num - 1]))
            {
                num--;
            }
            if (num == 0)
            {
                throw new ArgumentException("semantic cannot start with a digit.");
            }
            Offset        = offset;
            Format        = format;
            Semantic      = semantic;
            SemanticName  = semantic.Substring(0, num);
            SemanticIndex = ((num < semantic.Length) ? int.Parse(semantic.Substring(num)) : 0);
            m_hashCode    = Offset.GetHashCode() + Format.GetHashCode() + Semantic.GetHashCode();
        }