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

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

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