Example #1
0
        public bool StartCherryPickDialog(IWin32Window owner, IEnumerable<GitRevision> revisions)
        {
            if (revisions == null)
                throw new ArgumentNullException("revisions");
            Func<bool> action = () =>
            {
                FormCherryPick prevForm = null;

                try
                {
                    bool repoChanged = false;

                    foreach (var r in revisions)
                    {
                        var frm = new FormCherryPick(this, r);
                        if (prevForm != null)
                        {
                            frm.CopyOptions(prevForm);
                            prevForm.Dispose();
                        }
                        prevForm = frm;
                        if (frm.ShowDialog(owner) == DialogResult.OK)
                            repoChanged = true;
                        else
                            return repoChanged;
                    }

                    return repoChanged;
                }
                finally
                {
                    if (prevForm != null)
                    {
                        prevForm.Dispose();
                    }
                }
            };

            return DoActionOnRepo(owner, true, true, PreCherryPick, PostCherryPick, action);
        }
Example #2
0
        public bool StartCherryPickDialog(IWin32Window owner, GitRevision revision)
        {
            Func<bool> action = () =>
            {
                using (var form = new FormCherryPick(this, revision))
                {
                    return form.ShowDialog(owner) == DialogResult.OK;
                }
            };

            return DoActionOnRepo(owner, true, true, PreCherryPick, PostCherryPick, action);
        }