public static void TestGenericMethodInObjectLiteral() { c1 <string> o1 = new c1 <string>(); object o2 = new object(); object o3 = o1.m1 <int>(o2); Assert.AreEqual(0, o3); Assert.True(o1.Is <c1 <string> >()); Assert.True(o1.m2 <int>(o2)); }
public bool m2 <TB>(object p1) { c1 <TA> oThis = this; return(oThis.Is <c1 <TA> >()); }