public static void Test() { using (dlgCommandNameEditor dlg = new dlgCommandNameEditor()) { dlg._CommandDescriptors = WriterCommandNameDlgEditor.GetCommandDescriptors(dlg.GetType().Assembly.GetTypes()); dlg.ShowDialog(); } }
public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value) { using (dlgCommandNameEditor dlg = new dlgCommandNameEditor()) { dlg.InputCommandName = Convert.ToString(value); dlg.CommandDescriptors = GetCommandDescriptors(context); if (dlg.ShowDialog() == DialogResult.OK) { OnValueChanged(context, provider, dlg.InputCommandName); return(dlg.InputCommandName); } } return(value); }