1. 程式人生 > >saddle中每一個屬性賦值給到WebPlate中的同名屬性

saddle中每一個屬性賦值給到WebPlate中的同名屬性

一個 this getprop jstring 賦值 () sad ring property

//將saddle中每一個屬性賦值給到WebPlate中的同名屬性
foreach (PropertyInfo info in saddle.GetType().GetProperties())
{
try
{
string objString = info.Name;
object objValue = saddle.GetType().GetProperty(objString).GetValue(saddle, null);
this.GetType().GetProperty(objString).SetValue(this, objValue, null);
}
catch
{
}
}

saddle中每一個屬性賦值給到WebPlate中的同名屬性