/// <summary> /// Edits the value of the specified object using the editor style indicated /// by the GetEditStyle() method. /// </summary> public override object EditValue(System.ComponentModel.ITypeDescriptorContext context, IServiceProvider provider, object value) { IWindowsFormsEditorService service = provider.GetService(typeof(IWindowsFormsEditorService)) as IWindowsFormsEditorService; if (service != null) { // Load dialog with all assemblies of current AppDomain: TypeSelectionDialog dialog = new TypeSelectionDialog(); foreach (Assembly asm in AppDomain.CurrentDomain.GetAssemblies()) { dialog.AddAssembly(asm, false); } // Set default value: dialog.ChoosenType = (Type)value; // Show dialog: if (service.ShowDialog(dialog) == DialogResult.OK) { value = dialog.ChoosenType; } } return(value); }
/// <summary> /// Edits the value of the specified object using the editor style indicated /// by the GetEditStyle() method. /// </summary> public override object EditValue(System.ComponentModel.ITypeDescriptorContext context, IServiceProvider provider, object value) { IWindowsFormsEditorService service = provider.GetService(typeof(IWindowsFormsEditorService)) as IWindowsFormsEditorService; if (service != null) { // Load dialog with all assemblies of current AppDomain: TypeSelectionDialog dialog = new TypeSelectionDialog(); foreach (Assembly asm in AppDomain.CurrentDomain.GetAssemblies()) dialog.AddAssembly(asm, false); // Set default value: dialog.ChoosenType = (Type)value; // Show dialog: if (service.ShowDialog(dialog) == DialogResult.OK) { value = dialog.ChoosenType; } } return value; }
private void button4_Click(object sender, EventArgs e) { TypeSelectionDialog dlg = new TypeSelectionDialog(); dlg.AddAssembly(System.Reflection.Assembly.GetEntryAssembly(), true); dlg.ShowDialog(this); }