C# Enumerate properties of a class/type


SUBMITTED BY: Guest

DATE: Nov. 21, 2013, 5:35 a.m.

FORMAT: C#

SIZE: 158 Bytes

HITS: 816

  1. Type t = p.GetType();foreach(PropertyInfo info in t.GetProperties()){if(info.Name== propName && info.CanWrite){ info.SetValue(p, value,null);}}

comments powered by Disqus