コード例 #1
0
        /// <summary>
        /// Starts pull dialog
        /// </summary>
        /// <param name="owner">An implementation of IWin32Window that will own the modal dialog box.</param>
        /// <param name="pullOnShow"></param>
        /// <param name="pullCompleted">true if pull completed with no errors</param>
        /// <returns>if revision grid should be refreshed</returns>
        public bool StartPullDialog(IWin32Window owner, bool pullOnShow, string remoteBranch, out bool pullCompleted, ConfigureFormPull configProc)
        {
            pullCompleted = false;

            if (!RequiresValidWorkingDir(owner))
                return false;

            if (!InvokeEvent(owner, PrePull))
                return true;

            using (FormPull formPull = new FormPull(this, remoteBranch))
            {
                if (configProc != null)
                    configProc(formPull);

                DialogResult dlgResult;
                if (pullOnShow)
                    dlgResult = formPull.PullAndShowDialogWhenFailed(owner);
                else
                    dlgResult = formPull.ShowDialog(owner);

                if (dlgResult == DialogResult.OK)
                {
                    InvokeEvent(owner, PostPull);
                    pullCompleted = !formPull.ErrorOccurred;
                }
            }

            return true;//maybe InvokeEvent should have 'needRefresh' out parameter?
        }
コード例 #2
0
 public bool StartPullDialog(IWin32Window owner, bool pullOnShow, out bool pullCompleted, ConfigureFormPull configProc)
 {
     return StartPullDialog(owner, pullOnShow, null, out pullCompleted, configProc);
 }
コード例 #3
0
        /// <summary>
        /// Starts pull dialog
        /// </summary>
        /// <param name="owner">An implementation of IWin32Window that will own the modal dialog box.</param>
        /// <param name="pullOnShow"></param>
        /// <param name="pullCompleted">true if pull completed with no errors</param>
        /// <returns>if revision grid should be refreshed</returns>
        public bool StartPullDialog(IWin32Window owner, bool pullOnShow, out bool pullCompleted, ConfigureFormPull configProc)
        {
            pullCompleted = false;

            if (!RequiresValidWorkingDir(owner))
            {
                return(false);
            }

            if (!InvokeEvent(owner, PrePull))
            {
                return(true);
            }

            using (FormPull formPull = new FormPull())
            {
                if (configProc != null)
                {
                    configProc(formPull);
                }

                DialogResult dlgResult;
                if (pullOnShow)
                {
                    dlgResult = formPull.PullAndShowDialogWhenFailed(owner);
                }
                else
                {
                    dlgResult = formPull.ShowDialog(owner);
                }

                if (dlgResult == DialogResult.OK)
                {
                    InvokeEvent(owner, PostPull);
                    pullCompleted = !formPull.ErrorOccurred;
                }
            }

            return(true);//maybe InvokeEvent should have 'needRefresh' out parameter?
        }