示例#1
0
        static void test()
        {
            Class1.Item a = new Class1.Item();
            Type t = typeof(Class1);
            Type tinner = t.GetNestedType("Item", BindingFlags.NonPublic);
            PrivateObject o = new PrivateObject(tinner);
            o.SetFieldOrProperty("ID", "12345");

            PrivateObject class1 = new PrivateObject(typeof(Class1));
            dynamic list = (List<dynamic>)class1.GetFieldOrProperty("itemList");
            list.Add(o.Target);

            Console.WriteLine(class1.GetFieldOrProperty("GetFromListID"));
        }
示例#2
0
 public void test11()
 {
     Class1.Item a = new Class1.Item();
 }