62,046
社区成员
发帖
与我相关
我的任务
分享
public static List<object> GetRefection(object obj)
{
List<object> objs = new List<object>();
Type t = obj.GetType();
PropertyInfo[] pros = t.GetProperties();
for (int i = 0; i < 2; i++)
{
foreach (PropertyInfo pro in pros)
{
pro.SetValue(obj, i.ToString(), null);
}
objs.Add(obj);
}
return objs;
}
foreach (IMachine m in machineList) {
if (m is MachineLine) {
ProcessLine((MachineLine) m);
} else if (m is MachineCircle) {
ProcessLine((MachineCircle) m);
}
}