private void DeleteBindingMI_Click(object sender, EventArgs e)
{
try
{
if (BindingsDV.SelectedRows.Count == 0)
{
return;
}
if (Ask("Are you sure you want to delete these bindings?"))
{
foreach (DataGridViewRow row in BindingsDV.SelectedRows)
{
DataRowView source = row.DataBoundItem as DataRowView;
SslCertificateBinding binding = (SslCertificateBinding)source.Row[4];
HttpAccessRule.DeleteSslCertificateBinding(binding.IPAddress, binding.Port);
}
m_dataset.Tables[0].Clear();
// repopulate the grid.
foreach (SslCertificateBinding binding in HttpAccessRule.GetSslCertificateBindings())
{
AddRow(binding);
}
m_dataset.AcceptChanges();
BindingsDV.DataSource = m_dataset.Tables[0].DefaultView;
}
}
catch (Exception exception)
{
GuiUtils.HandleException(this.Text, MethodBase.GetCurrentMethod(), exception);
}
}
#endregion