コード例 #1
0
        public override int GetHashCode()
        {
            unchecked
            {
                int hashCode = 0;
#if NETSTANDARD2_0
                if (NamespaceURI != null)
                {
                    hashCode = NamespaceURI.GetHashCode();
                }
                if (LocalName != null)
                {
                    hashCode = (hashCode * 397) ^ LocalName.GetHashCode();
                }
#else
                if (NamespaceURI != null)
                {
                    hashCode = NamespaceURI.GetHashCode(StringComparison.Ordinal);
                }
                if (LocalName != null)
                {
                    hashCode = (hashCode * 397) ^ LocalName.GetHashCode(StringComparison.Ordinal);
                }
#endif
                return(hashCode);
            }
        }
コード例 #2
0
ファイル: XmlName.cs プロジェクト: zxyang178/Xamarin.Forms
 public override int GetHashCode()
 {
     unchecked
     {
         int hashCode = 0;
         if (NamespaceURI != null)
         {
             hashCode = NamespaceURI.GetHashCode();
         }
         if (LocalName != null)
         {
             hashCode = (hashCode * 397) ^ LocalName.GetHashCode();
         }
         return(hashCode);
     }
 }
コード例 #3
0
 public override int GetHashCode()
 {
     return((NamespaceURI?.GetHashCode() ?? 0) + (LocalName?.GetHashCode() ?? 0));
 }