private void btnNew_Click(object sender, EventArgs e) { var form = new NewEditMirrorForm(); if (form.ShowDialog() == DialogResult.OK) { var folder = form.Configuration; var item = new ListViewItem(new[] { folder.SourcePath, folder.MirrorPath }); lstFolders.Items.Add(item); } }
private void btnEdit_Click(object sender, EventArgs e) { var item = lstFolders.SelectedItems[0]; var configuration = new FolderConfiguration { SourcePath = item.SubItems[0].Text, MirrorPath = item.SubItems[1].Text }; var form = new NewEditMirrorForm(false, configuration); if (form.ShowDialog() == DialogResult.OK) { var folder = form.Configuration; item.SubItems[0].Text = folder.SourcePath; item.SubItems[1].Text = folder.MirrorPath; } }