public override void OnExecute(CommandEventArgs e) { using (ProjectCommitDialog dlg = new ProjectCommitDialog()) { dlg.Context = e.Context; dlg.PreserveWindowPlacement = true; dlg.LoadChanges(GetChanges(e)); dlg.LogMessageText = logMessage ?? ""; dlg.IssueNumberText = issueId ?? ""; DialogResult dr = dlg.ShowDialog(e.Context); logMessage = dlg.LogMessageText; issueId = dlg.IssueNumberText; if (dr == DialogResult.OK) { PendingChangeCommitArgs pca = new PendingChangeCommitArgs(); pca.StoreMessageOnError = true; // TODO: Commit it! List<PendingChange> toCommit = new List<PendingChange>(dlg.GetSelection()); dlg.FillArgs(pca); if (e.GetService<IPendingChangeHandler>().Commit(toCommit, pca)) { logMessage = issueId = null; } } } }
public override void OnExecute(CommandEventArgs e) { using (ProjectCommitDialog pcd = new ProjectCommitDialog()) { pcd.Context = e.Context; pcd.LogMessageText = storedLogMessage; pcd.IssueNumberText = storedIssueNumber; pcd.PreserveWindowPlacement = true; pcd.LoadItems(e.Selection.GetSelectedSvnItems(true)); DialogResult dr = pcd.ShowDialog(e.Context); storedLogMessage = pcd.LogMessageText; storedIssueNumber = pcd.IssueNumberText; if (dr != DialogResult.OK) return; PendingChangeCommitArgs pca = new PendingChangeCommitArgs(); pca.StoreMessageOnError = true; // TODO: Commit it! List<PendingChange> toCommit = new List<PendingChange>(pcd.GetSelection()); pcd.FillArgs(pca); e.GetService<IPendingChangeHandler>().Commit(toCommit, pca); } // not in the finally, because we want to preserve the message for a // non-successful commit storedLogMessage = null; storedIssueNumber = null; }