public void MyTestMethod() { var c = new UnitTest1.c { I = 1, S = "mys" }; var htmlAttributes = new { a = 1, b = 2, c = 3, style = "display:none;", c.I, c.S }; foreach (PropertyDescriptor propertyDescriptor in TypeDescriptor.GetProperties(htmlAttributes)) { Console.WriteLine(propertyDescriptor.Name + "==>" + propertyDescriptor.GetValue(htmlAttributes)); } }
public void MyTestMethod() { var c = new UnitTest1.c { I = 1, S = "mys" }; var htmlAttributes = new { a = 1, b = 2, c = 3, style = "display:none;", c.I, c.S }; foreach (PropertyDescriptor propertyDescriptor in TypeDescriptor.GetProperties(htmlAttributes)) { Console.WriteLine(propertyDescriptor.Name + "==>" + propertyDescriptor.GetValue(htmlAttributes)); } }