private async void DeleteListButton_Click(object sender, EventArgs e)
{
if (this.ListsList.SelectedItem == null) return;
using (ControlTransaction.Disabled(this))
{
ListElement list = (ListElement)this.ListsList.SelectedItem;
if (MessageBox.Show(Properties.Resources.ListManageDeleteLists1, Application.ProductName, MessageBoxButtons.OKCancel) == DialogResult.OK)
{
try
{
await this.tw.DeleteList(list.Id);
}
catch (WebApiException ex)
{
MessageBox.Show(Properties.Resources.ListManageOKButton2, ex.Message);
return;
}
try
{
await this.tw.GetListsApi();
}
catch (WebApiException ex)
{
MessageBox.Show(Properties.Resources.ListsDeleteFailed, ex.Message);
return;
}
this.ListsList.Items.Clear();
this.ListManage_Load(this, EventArgs.Empty);
}
}
}