public ConvertFrom ( ITypeDescriptorContext ctx, CultureInfo ci, object data ) : object | ||
ctx | ITypeDescriptorContext | |
ci | CultureInfo | |
data | object | |
Résultat | object |
public void ConvertFrom_TypeError () { TypeNameConverter cv = new TypeNameConverter (); object o; o = cv.ConvertFrom (null, null, 59); Assert.IsNull (o, "A1"); }
public void ConvertFrom () { TypeNameConverter cv = new TypeNameConverter (); object t; t = cv.ConvertFrom (null, null, typeof (object).AssemblyQualifiedName); Assert.IsTrue (t is Type, "A1"); object o = Activator.CreateInstance ((Type)t); Assert.AreEqual (typeof (object), o.GetType(), "A2"); }