Пример #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
 public bool CanAssignFrom(Type c)
 {
     return c.IsAssignableTo(this);
 }