示例#1
0
            public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
            {
                IWindowsFormsEditorService editorService = null;

                if (context != null && context.Instance != null && provider != null)
                {
                    editorService = (IWindowsFormsEditorService)provider.GetService(typeof(IWindowsFormsEditorService));
                    if (editorService != null)
                    {
                        StatisticalChart control = null;
                        if (context.Instance is StatisticalChart)
                        {
                            control = context.Instance as StatisticalChart;
                        }

                        StatisticalApperence form1 = new StatisticalApperence();
                        form1.IsReport    = control.IsReport;
                        form1.ChartParent = control as PMSChartCtrl;
                        DataSource ds = control.Apperence.Clone();
                        form1.SqlSource = control.Apperence;
                        if (DialogResult.OK == editorService.ShowDialog(form1))
                        {
                            value = form1.SqlSource.Clone();
                            control.SelectRecordFields = form1.SqlSource.YAixs;
                            control.XRecordField       = form1.XAixs;
                        }
                        return(value);
                    }
                }

                return(value);
            }
示例#2
0
        private void DealWithApperence()
        {
            if (this != null)
            {
                StatisticalChart control = null;
                if (this is StatisticalChart)
                {
                    control = this as StatisticalChart;
                }

                StatisticalApperence form1 = new StatisticalApperence();
                form1.IsReport    = control.IsReport;
                form1.ChartParent = control as PMSChartCtrl;
                DataSource ds = control.Apperence.Clone();
                form1.SqlSource = control.Apperence;
                if (DialogResult.OK == form1.ShowDialog())
                {
                    Apperence = form1.SqlSource.Clone();
                    control.SelectRecordFields = form1.SqlSource.YAixs;
                    control.XRecordField       = form1.XAixs;
                    if (null != Site)
                    {
                        IComponentChangeService cs = Site.GetService(typeof(IComponentChangeService)) as IComponentChangeService;
                        if (null != cs)
                        {
                            cs.OnComponentChanged(this, null, null, null);
                        }
                    }
                }
                else
                {
                    Apperence = ds;
                }
            }
        }