private void add_Click(object sender, EventArgs e) { var dlg = new AddFolderDialog(); if (dlg.ShowDialog(this) == DialogResult.OK) { var it = new FileExplorerConfig.FavoriteFolder { Directory = dlg.Path, Name = dlg.FolderName, Mask = dlg.Mask }; dirList.Items.Add(it); PopulateDirs(); } }