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)); }
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); } } } } } } }