private void DeleteBtn_Click(object sender, EventArgs e) { if (TemplateListView.SelectedItems.Count != 0) { Template template = TemplateListView.SelectedItems[0].Tag as Template; TemplateCore core = new TemplateCore(); core.DeleteTemplate(template); } BindTemplateList(temp.GetAllTemplate()); }
private void tsbTemplateDelete_Click(object sender, EventArgs e) { try { string name = txtName.Text.Trim(); if (string.IsNullOrEmpty(name)) { WriteStatus("Template 'Name' cannot be empty."); return; } templateCore.DeleteTemplate(name); ScrenTemplateControl(EnScrenTemplateControl.Default); ScrenRuleControl(EnScrenRuleControl.Default); WriteStatus("Deleted template"); AddTemplatesInListBox(); } catch (Exception ex) { WriteStatus($"Error trying to delete template: {ex.Message}"); } }