コード例 #1
0
        public static Type FindCommonType(this Type c1, Type c2)
        {
            if (c1.IsAssignableTo(c2))
            {
                return c2;
            }
            if (c2.IsAssignableTo(c1))
            {
                return c1;
            }

            // No EASY common type found
            // will have to look harder??
            return null;
        }
コード例 #2
0
ファイル: Type.cs プロジェクト: will14smith/JavaCompiler
 public bool CanAssignFrom(Type c)
 {
     return c.IsAssignableTo(this);
 }