public void DeleteSelected() { foreach (ListViewItem i in ResourcesListView.SelectedItems) { string name = ""; try { name = i.Text; Walker.Delete(name); } catch (Exception ex) { MessageBox.Show(this, ex.ToString(), "Can not delete resource [" + name + "].", MessageBoxButtons.OK, MessageBoxIcon.Error); } } }