Exemple #1
0
        /// <summary>
        /// 重载EditValue,编辑按钮动作属性的弹出窗口
        /// </summary>
        /// <param Name="context"></param>
        /// <param Name="provider"></param>
        /// <param Name="value"></param>
        /// <returns></returns>
        public override object EditValue(System.ComponentModel.ITypeDescriptorContext context,
                                         System.IServiceProvider provider, object value)
        {
            SVBtnChoicePage page = value as SVBtnChoicePage;

            if (page == null)
            {
                return(value);
            }

            IWindowsFormsEditorService edSvc = (IWindowsFormsEditorService)provider.GetService(typeof(IWindowsFormsEditorService));

            if (edSvc != null)
            {
                SVPageSelectWindow win = new SVPageSelectWindow();
                if (win.ShowDialog() == System.Windows.Forms.DialogResult.Yes)
                {
                    page.PageText = win.getPageText();
                    page.PageID   = win.getPageID();
                    return(page);
                }
            }

            return(value);
        }
Exemple #2
0
        public SVBtnChoicePage cloneObject()
        {
            MemoryStream    stream    = new MemoryStream();
            BinaryFormatter binFormat = new BinaryFormatter();

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

            return(result);
        }
Exemple #3
0
        /// <summary>
        /// 重写ConvertTo函数,用来自定义显示属性内容
        /// </summary>
        /// <param Name="context"></param>
        /// <param Name="culture"></param>
        /// <param Name="value"></param>
        /// <param Name="destinationType"></param>
        /// <returns></returns>
        public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
        {
            SVBtnChoicePage str = value as SVBtnChoicePage;

            if (str == null)
            {
                return(base.ConvertTo(context, culture, value, destinationType));
            }

            if (String.IsNullOrWhiteSpace(str.PageText))
            {
                return("无跳转页面");
            }

            return(String.Format("跳转到: {0}", str.PageText));
        }
        public SVButtonProperties()
        {
            _font        = new Font("华文细黑", 12);
            _rect        = new Rectangle(0, 0, 120, 60);
            _text        = "Button";
            _fText       = "None";
            _fMemo       = "";
            _bgcolor     = Color.FromArgb(236, 236, 236);
            _fgcolor     = Color.Black;
            _bgDownColor = _bgcolor;
            _btnType     = new SVBtnChoicePage();
            _controlType = "按钮";
            _enVarText   = new SVVarDefine();
            _btnVarText  = new SVVarDefine();

            _btnDownPic = new SVBitmap();
            _btnUpPic   = new SVBitmap();
            _isShowPic  = false;
            _isLock     = false;
        }
Exemple #5
0
 /// <summary>
 /// 判断两个对象的值是否相同
 /// </summary>
 /// <param Name="other">比较的另外一个输入对象</param>
 /// <returns>true-相等  false-不想等</returns>
 public Boolean isEqual(SVBtnChoicePage other)
 {
     return(true);
 }