※ 引述《tomex (tomex_ou)》之銘言:
: 例如,
: Button b = new Button();
: b.Text = "Hello";
: 我是否可能產生一個b的複本變數
: 且包含b的值!
: 因為b是一個ref(reference)變數
: 它是asign都是指向同物件,實在是很煩
: 除了String, Array有提供Clone()的複本外
: 一般都沒提供,若要具有相同的功能,
: 有辦法否?
MemberwiseClone()
淺層的clone喔!!
所以如果要深層就得自己做:P
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 140.113.209.101