示例#1
0
 private void DealWithTrendCurve()
 {
     if (null != this)
     {
         TrendCurve element = this as TrendCurve;
         if (null != element)
         {
             if (element.Parent == null ||
                 (element.Parent != null && element.Parent as PMS.Libraries.ToolControls.Report.Element.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);
                 TrendCurveApperence fbd = new TrendCurveApperence();
                 fbd.LabelSource = element.LabelSource;
                 fbd.ChartParent = element;
                 if (fbd.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                 {
                     LabelSource = fbd.LabelSource;
                     if (null != Site)
                     {
                         IComponentChangeService cs = Site.GetService(typeof(IComponentChangeService)) as IComponentChangeService;
                         if (null != cs)
                         {
                             cs.OnComponentChanged(this, null, null, null);
                         }
                     }
                 }
             }
             else
             {
                 TrendCurveApperence fbd = new TrendCurveApperence(GetSourceField(element.Parent as PMS.Libraries.ToolControls.Report.Element.IElement));
                 fbd.LabelSource = element.LabelSource;
                 fbd.ChartParent = element;
                 if (fbd.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                 {
                     LabelSource = fbd.LabelSource;
                     if (null != Site)
                     {
                         IComponentChangeService cs = Site.GetService(typeof(IComponentChangeService)) as IComponentChangeService;
                         if (null != cs)
                         {
                             cs.OnComponentChanged(this, null, null, null);
                         }
                     }
                 }
             }
         }
     }
 }
示例#2
0
 public override object EditValue(System.ComponentModel.ITypeDescriptorContext context, IServiceProvider provider, object value)
 {
     if (null != context && null != context.Instance && null != context.Container)
     {
         TrendCurve element = context.Instance as TrendCurve;
         if (null != element)
         {
             if (element.Parent == null ||
                 (element.Parent != null && element.Parent as PMS.Libraries.ToolControls.Report.Element.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);
                 TrendCurveApperence fbd = new TrendCurveApperence();
                 fbd.LabelSource = element.LabelSource;
                 fbd.ChartParent = element;
                 if (fbd.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                 {
                     value = fbd.LabelSource;
                 }
             }
             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);
                 TrendCurveApperence fbd = new TrendCurveApperence(GetSourceField(element.Parent as PMS.Libraries.ToolControls.Report.Element.IElement));
                 fbd.LabelSource = element.LabelSource;
                 fbd.ChartParent = element;
                 if (fbd.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                 {
                     value = fbd.LabelSource;
                 }
             }
         }
         return(value);
     }
     return(base.EditValue(context, provider, value));
 }