Exemple #1
0
        public SVCurveProperties()
        {
            _font        = new Font("华文细黑", 12);
            _rect        = new Rectangle(0, 0, 270, 260);
            _bgcolor     = Color.DimGray;
            _fgcolor     = Color.White;
            _min         = 0;
            _max         = 200;
            _interval    = 60;
            _step        = 60;
            _controlType = "趋势图";
            _isLock      = false;

            _forwardControl  = new SVVarDefine();
            _curControl      = new SVVarDefine();
            _backwardControl = new SVVarDefine();

            ///设置跳转变量
            _forwardControl.VarName       = SVCurveProperties.getIndexNumber();
            _curControl.VarName           = SVCurveProperties.getIndexNumber();
            _backwardControl.VarName      = SVCurveProperties.getIndexNumber();
            _forwardControl.VarBlockType  = 3;
            _curControl.VarBlockType      = 3;
            _backwardControl.VarBlockType = 3;
        }
Exemple #2
0
        public override object EditValue(System.ComponentModel.ITypeDescriptorContext context,
                                         System.IServiceProvider provider, object value)
        {
            SVButton svPanel = context.Instance as SVButton;

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

            ///获取当前页面中的所以趋势图
            List <SVCurveProperties> attribList = new List <SVCurveProperties>();

            foreach (var sv in svPanel.Parent.Controls)
            {
                SVCurve curve = sv as SVCurve;
                if (curve != null)
                {
                    attribList.Add(curve.Attrib);
                }
            }

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

            if (edSvc != null)
            {
                SVWpfControl variableDialog = new SVWpfControl();
                variableDialog.Width  = 100;
                variableDialog.Height = 100;

                SVWPFCurveSelect curveDialog = new SVWPFCurveSelect();
                curveDialog.listView.ItemsSource = attribList;
                variableDialog.addContent(curveDialog);
                edSvc.DropDownControl(variableDialog);

                SVCurveProperties obj = curveDialog.listView.SelectedItem as SVCurveProperties;
                if (obj != null)
                {
                    switch (svPanel.Attrib.ButtonType)
                    {
                    case 6:
                        svPanel.Attrib.BtnVarText = obj.ForwardControl;
                        break;

                    case 7:
                        svPanel.Attrib.BtnVarText = obj.CurControl;
                        break;

                    case 8:
                        svPanel.Attrib.BtnVarText = obj.BackwardControl;
                        break;
                    }

                    return(obj.ID.ToString());
                }
            }

            return(value);
        }
Exemple #3
0
 protected SVCurve(SerializationInfo info, StreamingContext context)
 {
     _attrib = (SVCurveProperties)info.GetValue("stream", typeof(SVCurveProperties));
 }