Ejemplo n.º 1
0
        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;
                    }
                }
            }
        }
Ejemplo n.º 2
0
        public override void OnExecute(CommandEventArgs e)
        {
            using (ProjectCommitDialog pcd = new ProjectCommitDialog())
            {
                pcd.Context         = e.Context;
                pcd.LogMessageText  = storedLogMessage;
                pcd.IssueNumberText = storedIssueNumber;

                pcd.PreserveWindowPlacement = true;

                bool recursive = (e.Command != AnkhCommand.CommitProjectFile);
                pcd.LoadItems(e.Selection.GetSelectedSvnItems(recursive));

                DialogResult dr = pcd.ShowDialog(e.Context);

                storedLogMessage  = pcd.LogMessageText;
                storedIssueNumber = pcd.IssueNumberText;

                if (dr != DialogResult.OK)
                {
                    return;
                }

                PendingChangeCommitArgs pca = new PendingChangeCommitArgs();
                pca.StoreMessageOnError = true;
                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;
        }