public void Dispose() { form.Controls.Remove(list_box); if (child_folder != null) { child_folder.Dispose(); child_folder = null; } if (child_file != null) { child_file.Dispose(); child_file = null; } }
public GUI_node_folder(Form in_form, string in_path, Point in_loc) { form = in_form; path = in_path; location = in_loc; if (Is_folder_there(path)) { list_box = new ListBox(); list_box.Location = location; string[] folders = ExtractFolders(path); foreach (string folder in folders) { list_box.Items.Add(folder); } list_box.SelectedIndexChanged += new EventHandler(list_box_index_change); form.Controls.Add(list_box); } if (Is_json_there(path)) { child_file = new GUI_node_file(form, path, new Point(location.X, location.Y + 130)); } }