출처1 : http://www.devpia.co.kr/MAEUL/Contents/Detail.aspx?BoardID=18&MAEULNO=8&no=1497&page=20
출처2 : http://debop.egloos.com/viewer/2876164
출처3 : http://community.bartdesmet.net/blogs/bart/archive/2006/09/28/4473.aspx
출처4 : http://www.nullskull.com/articles/20030114.asp
protected SumYearList SetSumYear(SumYearList s, string key, int value)
{
Type t = s.GetType();
System.Reflection.FieldInfo[] fList = t.GetFields();
foreach
(System.Reflection.FieldInfo info in fList)
{
if
(info.Name == key)
{
int tmp = (int)info.GetValue(s)
+ value;
info.SetValueDirect(__makeref(s), tmp);
//info.SetValue(s, tmp);
}
}
return s;
}