void AddButtonClick(object sender, EventArgs e) { using (AddOpenWithEntryDialog dlg = new AddOpenWithEntryDialog()) { if (dlg.ShowDialog(this) == DialogResult.OK) { ExternalProcessDisplayBinding binding = new ExternalProcessDisplayBinding { FileExtension = fileExtension, CommandLine = dlg.ProgramName, Title = dlg.DisplayName, Id = Guid.NewGuid().ToString() }; programListBox.Items.Add(new ListEntry(SD.DisplayBindingService.AddExternalProcessDisplayBinding(binding), false)); } } }