コード例 #1
0
        internal bool Equals(ScopeID scopeID, IEqualityComparer <object> comparer)
        {
            if ((object)scopeID == null)
            {
                return(false);
            }
            if (m_scopeValues == scopeID.m_scopeValues)
            {
                return(true);
            }
            int scopeValueCount = ScopeValueCount;

            if (scopeValueCount != scopeID.ScopeValueCount)
            {
                return(false);
            }
            for (int i = 0; i < scopeValueCount; i++)
            {
                if (!m_scopeValues[i].Equals(scopeID.m_scopeValues[i], comparer))
                {
                    return(false);
                }
            }
            return(true);
        }
コード例 #2
0
        internal int Compare(ScopeID scopeID, IComparer <object> comparer)
        {
            int scopeValueCount = ScopeValueCount;

            if (scopeValueCount == 0)
            {
                if ((object)scopeID == null || scopeID.ScopeValueCount == 0)
                {
                    return(0);
                }
                return(-1);
            }
            if ((object)scopeID == null || scopeID.ScopeValueCount == 0)
            {
                return(1);
            }
            if (scopeValueCount != scopeID.ScopeValueCount)
            {
                throw new ArgumentException();
            }
            for (int i = 0; i < scopeValueCount; i++)
            {
                int num = comparer.Compare(m_scopeValues[i].Value, scopeID.m_scopeValues[i].Value);
                if (num != 0)
                {
                    return(num);
                }
            }
            return(0);
        }
コード例 #3
0
 internal bool Equals(ScopeID scopeID)
 {
     if ((object)this == scopeID)
     {
         return(true);
     }
     if ((object)scopeID == null)
     {
         return(false);
     }
     return(Equals(scopeID, null));
 }
コード例 #4
0
 internal ScopeID(ScopeID scopeID)
     : this(scopeID.m_scopeValues)
 {
 }