Esempio n. 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)
                {
                    NewRadarChart control = null;
                    if (context.Instance is NewRadarChart)
                    {
                        control = context.Instance as NewRadarChart;
                    }

                    RadarApperenceFrm form1 = new RadarApperenceFrm();

                    form1.ChartParent = control as NewRadarChart;
                    DataSource ds = control.Apperence.Clone();
                    form1.PMSChartAppearance = ds.PMSChartAppearance;
                    form1.chartAreaList      = ds.ChartAreaList;
                    form1.legendList         = ds.LegendList;
                    form1.seriesList         = ds.SeriesList;
                    form1.titleList          = ds.TitleList;
                    DialogResult dr = editorService.ShowDialog(form1);
                    if (DialogResult.OK == dr)
                    {
                        value            = ds;
                        control.isIntial = true;
                    }
                    return(value);
                }
            }
            return(value);
        }
Esempio n. 2
0
        public override object Clone()
        {
            NewRadarChart pcc = new NewRadarChart();

            if (this.SourceField != null)
            {
                pcc.SourceField = this.SourceField.Clone();
            }

            pcc.Apperence = this.Apperence.Clone();
            if (this.Apperence.SeriesList.Count != 0)
            {
                pcc.Apperence.SeriesList[0].Legend = this.Apperence.SeriesList[0].Legend;
            }

            pcc.RunMode        = this.RunMode;
            pcc.Location       = new Point(this.Location.X, this.Location.Y);
            pcc.OriginPosition = new Point(this.Location.X, this.Location.Y);
            pcc.Height         = this.Height;
            pcc.Width          = this.Width;
            pcc.ChartType      = this.ChartType;
            if (this.RadarSeriesColor != null)
            {
                pcc.RadarSeriesColor = this.RadarSeriesColor.Clone();
            }
            for (int i = 0; i < RadarClassifyList.Count; i++)
            {
                pcc.RadarClassifyList.Add(this.RadarClassifyList[i].Clone());
            }
            if (this.OriginHeight > 0 || this.OriginWidth > 0)
            {
                pcc.OriginHeight = this.OriginHeight;
                pcc.OriginWidth  = this.OriginWidth;
            }
            else
            {
                pcc.OriginWidth  = this.Width;
                pcc.OriginHeight = this.Height;
            }

            return(pcc);
        }