public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object Value) { edSvc = (IWindowsFormsEditorService)provider.GetService(typeof(IWindowsFormsEditorService)); Base c = context.Instance is Base ? context.Instance as Base : ((object[])context.Instance)[0] as Base; if (c != null && c.Report != null) { DataTreeView tree = new DataTreeView(); tree.BorderStyle = BorderStyle.None; tree.ShowDataSources = false; tree.ShowRelations = false; tree.ShowColumns = false; tree.ShowNone = true; tree.ShowVariables = false; tree.ShowParameters = true; tree.ShowTotals = false; tree.CreateNodes(c.Report.Dictionary); tree.SelectedItem = (string)Value; tree.AfterSelect += new TreeViewEventHandler(tree_AfterSelect); if (FSize.Width > 0) { tree.Size = FSize; } edSvc.DropDownControl(tree); FSize = tree.Size; return(tree.SelectedItem); } return(Value); }
public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object Value) { // this method is called when we click on drop-down arrow edSvc = (IWindowsFormsEditorService)provider.GetService(typeof(IWindowsFormsEditorService)); if (context != null && context.Instance != null) { Base component = context.Instance is Base ? context.Instance as Base : ((object[])context.Instance)[0] as Base; DataTreeView tree = new DataTreeView(); tree.BorderStyle = BorderStyle.None; tree.ShowEnabledOnly = true; tree.ShowNone = true; tree.ShowRelations = true; tree.ShowDataSources = false; tree.ShowVariables = false; tree.ShowParameters = false; tree.ShowTotals = false; tree.CreateNodes(component.Report.Dictionary); tree.SelectedItem = Value == null ? "" : (Value as Relation).Alias; tree.NodeMouseClick += new TreeNodeMouseClickEventHandler(tree_NodeMouseClick); if (FSize.Width > 0) { tree.Size = FSize; } edSvc.DropDownControl(tree); FSize = tree.Size; return(tree.SelectedNode.Tag as Relation); } else { return(Value); } }
/// <inheritdoc/> public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object Value) { // this method is called when we click on drop-down arrow edSvc = (IWindowsFormsEditorService)provider.GetService(typeof(IWindowsFormsEditorService)); if (context != null && context.Instance is Base) { Base component = context.Instance as Base; DataTreeView tree = new DataTreeView(); tree.BorderStyle = BorderStyle.None; tree.ShowRelations = true; tree.ShowColumns = true; tree.ShowEnabledOnly = true; tree.ShowNone = true; tree.CreateNodes(component.Report.Dictionary); tree.SelectedItem = (string)Value; tree.NodeMouseClick += new TreeNodeMouseClickEventHandler(tree_NodeMouseClick); if (FSize.Width > 0) { tree.Size = FSize; } edSvc.DropDownControl(tree); FSize = tree.Size; return(tree.SelectedItem); } else { return(Value); } }
public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object Value) { edSvc = (IWindowsFormsEditorService)provider.GetService(typeof(IWindowsFormsEditorService)); Hyperlink hyperlink = context.Instance is Hyperlink ? context.Instance as Hyperlink : ((object[])context.Instance)[0] as Hyperlink; if (hyperlink != null && (hyperlink.Kind == HyperlinkKind.DetailReport || hyperlink.Kind == HyperlinkKind.DetailPage)) { Report report = null; bool isAnotherReport = hyperlink.Kind == HyperlinkKind.DetailReport && !String.IsNullOrEmpty(hyperlink.DetailReportName); if (isAnotherReport) { report = hyperlink.GetReport(false); } else { report = hyperlink.Report; } DataTreeView tree = new DataTreeView(); tree.BorderStyle = BorderStyle.None; tree.ShowDataSources = false; tree.ShowRelations = false; tree.ShowColumns = false; tree.ShowNone = true; tree.ShowVariables = false; tree.ShowParameters = true; tree.ShowTotals = false; tree.CreateNodes(report.Dictionary); tree.SelectedItem = (string)Value; tree.AfterSelect += new TreeViewEventHandler(tree_AfterSelect); if (FSize.Width > 0) { tree.Size = FSize; } edSvc.DropDownControl(tree); if (isAnotherReport) { report.Dispose(); } FSize = tree.Size; return(tree.SelectedItem); } return(Value); }