public override object ConvertTo(ITypeDescriptorContext ctx, CultureInfo ci, object value, Type type) { // Make the check here since for some reason value.GetType is not System.Type but RuntimeType if (!(value is Type)) { ValidateType(value, typeof(Type)); } string result = null; if (value != null) { result = ((Type)value).AssemblyQualifiedName; } return result; }
public void ConvertTo () { TypeNameConverter cv = new TypeNameConverter (); Assert.AreEqual (typeof (string).AssemblyQualifiedName, cv.ConvertTo (null, null, typeof (string), typeof (string)), "A1"); }