摘要:
如有一个如下类:class EquipmentPiece { private: int IDNumber; public: EquipmentPiece(int IDNumber) : IDNumber(IDNumber) {}; };以下列出几种初始化的方法:、对象数组int ID1, ID2, ID3; EquipmentPiece bestPieces[] = { EquipmentPiece(ID1), EquipmentPiece(ID2), EquipmentPiece(ID3) };注意:EquipmentPiece bestPieces[10];//no appropriate 阅读全文
摘要:
public static bool ObjectEquel(TempClass obj1, TempClass obj2) { Type type1 = obj1.GetType(); Type type2 = obj2.GetType(); System.Reflection.PropertyInfo[] properties1 = type1.GetProperties(); System.Reflection.PropertyInfo[] properties2 = type2.GetProperties(); bool IsMatch = true; for (int i =... 阅读全文