Exemplo n.º 1
0
        private void DeleteForm()
        {
            if (selectedId == -1)
            {
                return;
            }

            flowLayoutPanel1.Controls.Remove(buttons[selectedId]);
            buttons.Remove(selectedId);
            ManagerForm.OnDeleteForm(selectedId);
            SaveManager.Delete(selectedId);
        }
Exemplo n.º 2
0
        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);
        }