//建立一个副本 override public object cloneObject() { MemoryStream stream = new MemoryStream(); BinaryFormatter binFormat = new BinaryFormatter(); binFormat.Serialize(stream, this); stream.Position = 0; SVBinary result = (SVBinary)binFormat.Deserialize(stream); result.refreshPropertyToPanel(); return(result); }
public SVBinaryTypeWindow(SVBinary binary) { InitializeComponent(); _binary = binary; this.customGroupBox.init(); this.customGroupBox.setEnabledText("文本"); this.picGroupBox.init(); this.picGroupBox.setEnabledText("图片"); if (binary.Attrib.Type == 0) { this.textBoxTrue.Text = binary.Attrib.CustomTrueText; this.textBoxFalse.Text = binary.Attrib.CustomFlaseText; customGroupBox.setChecked(true); } else { picGroupBox.setChecked(true); if (_binary.Attrib.CustomTrueText != null) { String file = Path.Combine(SVProData.IconPath, _binary.Attrib.CustomTrueText); if (File.Exists(file)) { setButtonBackGd(truePic, file); } } if (_binary.Attrib.CustomFlaseText != null) { String file = Path.Combine(SVProData.IconPath, _binary.Attrib.CustomFlaseText); if (File.Exists(file)) { setButtonBackGd(falsePic, file); } } } this.customGroupBox.EnabledChanged += new EventHandler(customGroupBox_EnabledChanged); this.picGroupBox.EnabledChanged += new EventHandler(picGroupBox_EnabledChanged); this.truePic.Click += new EventHandler(truePic_Click); this.falsePic.Click += new EventHandler(falsePic_Click); this.exPic.Click += new EventHandler(exPic_Click); }