Beispiel #1
0
        public override bool Equals(object o)
        {
            ProjectingType other = o as ProjectingType;

            return(other != null &&
                   Projector == other.Projector &&
                   UnderlyingType.Equals(other.UnderlyingType));
        }
Beispiel #2
0
        // We could have used the default implementation of this on Type
        // if it handled special cases like generic type constraints
        // and interfaces->objec.
        public override bool IsSubclassOf(Type c)
        {
            ProjectingType otherType = c as ProjectingType;

            if (otherType == null || Projector != otherType.Projector)
            {
                return(false);
            }

            return(UnderlyingType.IsSubclassOf(otherType.UnderlyingType));
        }
Beispiel #3
0
        public override bool IsEquivalentTo(Type other)
        {
            ProjectingType otherType = other as ProjectingType;

            if (otherType == null || Projector != otherType.Projector)
            {
                return(false);
            }

            return(UnderlyingType.IsEquivalentTo(otherType.UnderlyingType));
        }
Beispiel #4
0
        public override bool IsAssignableFrom(Type c)
        {
            ProjectingType otherType = c as ProjectingType;

            if (otherType == null || Projector != otherType.Projector)
            {
                return(false);
            }

            return(UnderlyingType.IsAssignableFrom(otherType.UnderlyingType));
        }
Beispiel #5
0
        public Type Unproject(Type value)
        {
            ProjectingType projectingType = value as ProjectingType;

            if ((object)projectingType != null)
            {
                return(projectingType.UnderlyingType);
            }
            else
            {
                return(value);
            }
        }