Esempio n. 1
0
        /// <summary>
        /// 通过序列化的机制来克隆一个当前对象并返回
        /// </summary>
        /// <returns>一个新的按钮对象</returns>
        override public object cloneObject()
        {
            MemoryStream    stream    = new MemoryStream();
            BinaryFormatter binFormat = new BinaryFormatter();

            binFormat.Serialize(stream, this);
            stream.Position = 0;

            SVButton result = (SVButton)binFormat.Deserialize(stream);

            result.refreshPropertyToPanel();

            return(result);
        }
Esempio n. 2
0
        /// <summary>
        /// 单击确定窗口对应的事件
        /// </summary>
        /// <param Name="sender"></param>
        /// <param Name="e"></param>
        private void okBtn_Click(object sender, System.EventArgs e)
        {
            if (colorGroupBox.checkEnabled())
            {
                _button.Attrib.BackColorgroundDown = colorBtnDown.BackColor;
                _button.Attrib.BackColorground     = colorBtnUp.BackColor;
                _button.Attrib.IsShowPic           = false;
            }
            else
            {
                _button.Attrib.IsShowPic = true;
            }

            _button.refreshPropertyToPanel();
            this.DialogResult = System.Windows.Forms.DialogResult.Yes;
        }