Beispiel #1
0
        public TrendCurve(PMSChartCtrl Aim)
        {
            if (Aim != null)
            {
                if (Aim.SourceField != null)
                {
                    this.SourceField = Aim.SourceField.Clone();
                }
                this.IsReport = this.IsReport;
                if (Aim.SelectRecordFields != null)
                {
                    this.SelectRecordFields = new List <string>();

                    foreach (string node in Aim.SelectRecordFields)
                    {
                        this.SelectRecordFields.Add(node);
                    }
                }
                this.SqlSource    = Aim.SqlSource.Clone();
                this.XRecordField = Aim.XRecordField;
                this.RunMode      = Aim.RunMode;
                this.Location     = new Point(Aim.Location.X, Aim.Location.Y);
                //this.OriginPosition = new Point(Aim.Location.X, Aim.Location.Y);
                this.Height  = Aim.Height;
                this.Width   = Aim.Width;
                this.Visible = Aim.Visible;
                //this.chart1.BorderlineColor = Aim.chart1.BorderlineColor;
                //this.chart1.BorderlineDashStyle = Aim.chart1.BorderlineDashStyle;
                //this.chart1.BorderlineWidth = Aim.chart1.BorderlineWidth;
            }
        }
Beispiel #2
0
 public override object EditValue(System.ComponentModel.ITypeDescriptorContext context, IServiceProvider provider, object value)
 {
     if (null != context && null != context.Instance && null != context.Container)
     {
         PMSChartCtrl element = context.Instance as PMSChartCtrl;
         if (null != element)
         {
             if (element.Parent == null ||
                 (element.Parent != null && element.Parent as IPmsReportDataBind == null))
             {
                 PMS.Libraries.ToolControls.PmsSheet.PmsPublicData.SourceField sfAll = (PMS.Libraries.ToolControls.PMSPublicInfo.CurrentPrjInfo.GetCurrentReportDataDefine()) as PMS.Libraries.ToolControls.PmsSheet.PmsPublicData.SourceField;
                 //SourceBindDialog fbd = new SourceBindDialog(sfAll, element.SourceField);
                 PMS.Libraries.ToolControls.Report.Controls.EditorDialog.SourceBindDialog fbd = new PMS.Libraries.ToolControls.Report.Controls.EditorDialog.SourceBindDialog(sfAll, element.SourceField, true);
                 if (fbd.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                 {
                     value = fbd.SourceField;
                 }
             }
             else
             {
                 PMS.Libraries.ToolControls.Report.Controls.EditorDialog.SourceBindDialog fbd = new PMS.Libraries.ToolControls.Report.Controls.EditorDialog.SourceBindDialog(GetSourceField(element.Parent as IElement), element.SourceField, true);
                 if (fbd.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                 {
                     value = fbd.SourceField;
                 }
             }
         }
         return(value);
     }
     return(base.EditValue(context, provider, value));
 }
Beispiel #3
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)
                    {
                        PMSChartCtrl control = null;
                        if (context.Instance.GetType() == typeof(PMSChartCtrl))
                        {
                            control = (PMSChartCtrl)context.Instance;
                        }

                        FormSql form1 = new FormSql();
                        form1.StartPosition = FormStartPosition.CenterParent;
                        form1.SqlSource     = control.SqlSource;
                        if (DialogResult.OK == editorService.ShowDialog(form1))
                        {
                            value = form1.SqlSource;
                        }
                        return(value);
                    }
                }

                return(value);
            }
        public Control ToControl(bool childTranslate = false)
        {
            PMSChartCtrl result = null;

            if (_Context != null)
            {
                MemoryStream temp = new MemoryStream(_Context);
                result = new PMSChartCtrl(temp);
            }
            if (result != null)
            {
                result.Width    = this.Width;
                result.Height   = this.Height;
                result.Location = this.Location;
            }
            return(result as Control);
        }
Beispiel #5
0
 private void DealWithDataTable()
 {
     if (null != this)
     {
         PMSChartCtrl element = this as PMSChartCtrl;
         if (null != element)
         {
             if (element.Parent == null ||
                 (element.Parent != null && element.Parent as IPmsReportDataBind == null))
             {
                 PMS.Libraries.ToolControls.PmsSheet.PmsPublicData.SourceField sfAll = (PMS.Libraries.ToolControls.PMSPublicInfo.CurrentPrjInfo.GetCurrentReportDataDefine()) as PMS.Libraries.ToolControls.PmsSheet.PmsPublicData.SourceField;
                 //SourceBindDialog fbd = new SourceBindDialog(sfAll, element.SourceField);
                 PMS.Libraries.ToolControls.Report.Controls.EditorDialog.SourceBindDialog fbd = new PMS.Libraries.ToolControls.Report.Controls.EditorDialog.SourceBindDialog(sfAll, element.SourceField, true);
                 if (fbd.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                 {
                     DataTable = fbd.SourceField;
                     if (null != Site)
                     {
                         IComponentChangeService cs = Site.GetService(typeof(IComponentChangeService)) as IComponentChangeService;
                         if (null != cs)
                         {
                             cs.OnComponentChanged(this, null, null, null);
                         }
                     }
                 }
             }
             else
             {
                 PMS.Libraries.ToolControls.Report.Controls.EditorDialog.SourceBindDialog fbd = new PMS.Libraries.ToolControls.Report.Controls.EditorDialog.SourceBindDialog(GetSourceField(element.Parent as IElement), element.SourceField, true);
                 if (fbd.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                 {
                     DataTable = fbd.SourceField;
                     if (null != Site)
                     {
                         IComponentChangeService cs = Site.GetService(typeof(IComponentChangeService)) as IComponentChangeService;
                         if (null != cs)
                         {
                             cs.OnComponentChanged(this, null, null, null);
                         }
                     }
                 }
             }
         }
     }
 }