private void DeleteForm() { if (selectedId == -1) { return; } flowLayoutPanel1.Controls.Remove(buttons[selectedId]); buttons.Remove(selectedId); ManagerForm.OnDeleteForm(selectedId); SaveManager.Delete(selectedId); }
public static void Delete(int id) { if (!Directory.Exists(RootPath)) { return; } string path = Path.Combine(RootPath, $"Postit{id}.json"); if (!File.Exists(path)) { return; } File.Delete(path); ManagerForm.OnDeleteForm(id); }