示例#1
0
        public override object EditValue(System.ComponentModel.ITypeDescriptorContext context,
                                         System.IServiceProvider provider, object value)
        {
            SVLabel svLabel = context.Instance as SVLabel;

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

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

            if (edSvc != null)
            {
                SVWpfControl textDialog = new SVWpfControl();
                textDialog.Width  = 200;
                textDialog.Height = 120;

                SVWPFLabelTextEdit edit = new SVWPFLabelTextEdit();
                edit.textBox.DataContext = value;
                textDialog.addContent(edit);
                edSvc.DropDownControl(textDialog);
                value = edit.textBox.Text;

                return(value);
            }

            return(value);
        }
示例#2
0
        //建立一个副本
        override public object cloneObject()
        {
            MemoryStream    stream    = new MemoryStream();
            BinaryFormatter binFormat = new BinaryFormatter();

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

            result.refreshPropertyToPanel();

            return(result);
        }