System.Xml.Schema.DatatypeImplementation.IsComparable C# (CSharp) Method

IsComparable() private method

private IsComparable ( XmlSchemaDatatype dtype ) : bool
dtype XmlSchemaDatatype
return bool
        internal override bool IsComparable(XmlSchemaDatatype dtype)
        {
            XmlTypeCode thisCode = this.TypeCode;
            XmlTypeCode otherCode = dtype.TypeCode;

            if (thisCode == otherCode)
            { //They are both same built-in type or one is list and the other is list's itemType
                return true;
            }
            if (GetPrimitiveTypeCode(thisCode) == GetPrimitiveTypeCode(otherCode))
            {
                return true;
            }
            if (this.IsDerivedFrom(dtype) || dtype.IsDerivedFrom(this))
            { //One is union and the other is a member of the union
                return true;
            }
            return false;
        }