public override object EditValue(System.ComponentModel.ITypeDescriptorContext context, IServiceProvider provider, object value) { IWindowsFormsEditorService editorService = null; if (null != context && null != context.Instance) { CurveSeries pcc = context.Instance as CurveSeries; if (null != pcc && null != pcc._Tag && pcc._Tag is TreeNode) { editorService = (IWindowsFormsEditorService)provider.GetService(typeof(IWindowsFormsEditorService)); if (editorService != null) { YaxisChoose rfc = new YaxisChoose(editorService); rfc.CurrentYaxis = pcc.BindingYaxis; List <string> lp = new List <string>(); if ((pcc._Tag as TreeNode).Parent != null && (pcc._Tag as TreeNode).Parent.Parent != null && (pcc._Tag as TreeNode).Parent.Parent.Nodes[Properties.Resources.ResourceManager.GetString("context0015")] != null) { TreeNode temp = (pcc._Tag as TreeNode).Parent.Parent.Nodes[Properties.Resources.ResourceManager.GetString("context0015")]; if (temp.Nodes != null && temp.Nodes.Count > 0) { foreach (TreeNode tempnode in temp.Nodes) { if (!lp.Contains(tempnode.Name)) { lp.Add(tempnode.Name); } } } } rfc.Yaxis = lp; editorService.DropDownControl(rfc); if (!string.IsNullOrEmpty(rfc.CurrentYaxis)) { value = rfc.CurrentYaxis; } return(value); } } else { MessageBox.Show(Properties.Resources.ResourceManager.GetString("message0004")); } } return(base.EditValue(context, provider, value)); }
public override object EditValue(System.ComponentModel.ITypeDescriptorContext context, IServiceProvider provider, object value) { IWindowsFormsEditorService editorService = null; if (null != context && null != context.Instance) { CurveSeries pcc = context.Instance as CurveSeries; if (null != pcc && null != pcc.SourceField) { editorService = (IWindowsFormsEditorService)provider.GetService(typeof(IWindowsFormsEditorService)); if (editorService != null) { FieldTreeViewData sfAll = (PMS.Libraries.ToolControls.PMSPublicInfo.CurrentPrjInfo.GetCurrentReportDataDefine()) as FieldTreeViewData; RelationFieldChoose rfc = new RelationFieldChoose(editorService); rfc.strRField = pcc.BindingField; List <PmsField> lp = new List <PmsField>(); List <SourceField> lpdb = pcc.SourceField.GetSubSourceField(sfAll); foreach (SourceField pdb in lpdb) { try { if (!string.IsNullOrEmpty(pdb.DataType)) { string typ = pdb.DataType.ToUpper(); if (typ.Equals("INT", StringComparison.InvariantCultureIgnoreCase) || typ.Equals("FLOAT", StringComparison.InvariantCultureIgnoreCase) || typ.Equals("REAL", StringComparison.InvariantCultureIgnoreCase) || typ.Equals("INT32", StringComparison.InvariantCultureIgnoreCase) || typ.Equals("INT16", StringComparison.InvariantCultureIgnoreCase) || typ.Equals("INT64", StringComparison.InvariantCultureIgnoreCase) || typ.Equals("SYSTEM.SINGLE", StringComparison.InvariantCultureIgnoreCase) || typ.Equals("SYSTEM.DOUBLE", StringComparison.InvariantCultureIgnoreCase) || typ.Equals("SYSTEM.INT32", StringComparison.InvariantCultureIgnoreCase) || typ.Equals("SYSTEM.DECIMAL", StringComparison.InvariantCultureIgnoreCase)) { if (pcc._seriesDataForAppearance != null && !pcc._seriesDataForAppearance.Contains(pdb.RecordField)) { PmsField pf = new PmsField(); pf.fieldName = pdb.RecordField; pf.fieldDescription = pdb.Name; lp.Add(pf); } } } } catch { } } rfc.pmsFieldList = lp; editorService.DropDownControl(rfc); if (!string.IsNullOrEmpty(rfc.strRField)) { value = rfc.strRField; } return(value); } } else { MessageBox.Show(Properties.Resources.ResourceManager.GetString("message0004")); } } return(base.EditValue(context, provider, value)); }