/// <summary> /// Car の概要の説明です /// </summary> public class Car { private System.Drawing.Color color; private int height; private int width; public Car(Car car) { // // TODO: コンストラクタ ロジックをここに追加します // this.color = car.color; this.height = car.height; this.width = car.width; } }
public class car { public string aa = null; car(car c) { foreach (System.Reflection.FieldInfo fi in typeof(car).GetFields()) { fi.SetValue(this,fi.GetValue(c); } } }
//复制属性和字段 public class car { public string aa = null; car(car c) { foreach (System.Reflection.FieldInfo fi in typeof(car).GetFields()) { fi.SetValue(this,fi.GetValue(c)); } foreach (System.Reflection.PropertyInfo fi in typeof(car).GetProperties()) { fi.SetValue(this,fi.GetValue(c)); } } }
/// Car の概要の説明です
/// </summary>
public class Car
{
private System.Drawing.Color color;
private int height;
private int width; public Car(Car car)
{
//
// TODO: コンストラクタ ロジックをここに追加します
//
this.color = car.color;
this.height = car.height;
this.width = car.width;
}
}
{
public string aa = null;
car(car c)
{
foreach (System.Reflection.FieldInfo fi in typeof(car).GetFields())
{
fi.SetValue(this,fi.GetValue(c);
}
}
}
public class car
{
public string aa = null;
car(car c)
{
foreach (System.Reflection.FieldInfo fi in typeof(car).GetFields())
{
fi.SetValue(this,fi.GetValue(c));
} foreach (System.Reflection.PropertyInfo fi in typeof(car).GetProperties())
{
fi.SetValue(this,fi.GetValue(c));
}
}
}