コード例 #1
0
ファイル: ProjectingType.cs プロジェクト: zqb971/mef
        public override bool Equals(object o)
        {
            ProjectingType other = o as ProjectingType;

            return(other != null &&
                   Projector == other.Projector &&
                   UnderlyingType.Equals(other.UnderlyingType));
        }
コード例 #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));
        }
コード例 #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));
        }
コード例 #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));
        }
コード例 #5
0
ファイル: Projector.cs プロジェクト: zhy29563/MyMEF
        public Type Unproject(Type value)
        {
            ProjectingType projectingType = value as ProjectingType;

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