public override object ConvertFrom(ITypeDescriptorContext ctx, CultureInfo ci, object data) { Type result = TypeUtil.GetTypeWithReflectionPermission((string)data, false); if (result == null) { throw new ArgumentException(SR.GetString(SR.Type_cannot_be_resolved, (string)data)); } return result; } }
public void ConvertFrom_TypeError () { TypeNameConverter cv = new TypeNameConverter (); object o; o = cv.ConvertFrom (null, null, 59); Assert.IsNull (o, "A1"); }