当前位置: 首页>>代码示例>>C#>>正文


C# FormProcess.ErrorOccurred方法代码示例

本文整理汇总了C#中GitUI.FormProcess.ErrorOccurred方法的典型用法代码示例。如果您正苦于以下问题:C# FormProcess.ErrorOccurred方法的具体用法?C# FormProcess.ErrorOccurred怎么用?C# FormProcess.ErrorOccurred使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在GitUI.FormProcess的用法示例。


在下文中一共展示了FormProcess.ErrorOccurred方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ShowDialog

 public static bool ShowDialog(IWin32Window owner, string process, string arguments, string aWorkingDirectory, string input, bool useDialogSettings)
 {
     using (var formProcess = new FormProcess(process, arguments, aWorkingDirectory, input, useDialogSettings))
     {
         formProcess.ShowDialog(owner);
         return !formProcess.ErrorOccurred();
     }
 }
开发者ID:Carbenium,项目名称:gitextensions,代码行数:8,代码来源:FormProcess.cs

示例2: OkClick

        private void OkClick(object sender, EventArgs e)
        {
            var process = new FormProcess(GitCommandHelpers.MergeBranchCmd(Branches.Text, fastForward.Checked, squash.Checked, noCommit.Checked, _NO_TRANSLATE_mergeStrategy.Text));
            process.ShowDialog();

            var wasConflict = MergeConflictHandler.HandleMergeConflicts();

            if (!process.ErrorOccurred() || wasConflict)
                Close();
        }
开发者ID:jscoles,项目名称:gitextensions,代码行数:10,代码来源:FormMergeBranch.cs

示例3: BisectRange

 private void BisectRange( string startRevision, string endRevision )
 {
     var command = GitCommandHelpers.MarkRevisionBisectCmd(true, startRevision);
     var form = new FormProcess(command);
     form.ShowDialog(this);
     if (!form.ErrorOccurred())
     {
         command = GitCommandHelpers.MarkRevisionBisectCmd(false, endRevision);
         form = new FormProcess(command);
         form.ShowDialog(this);
     }
 }
开发者ID:nitoyon,项目名称:gitextensions,代码行数:12,代码来源:FormBisect.cs

示例4: BisectRange

        private void BisectRange(string startRevision, string endRevision)
        {
            var command = GitCommandHelpers.ContinueBisectCmd(GitBisectOption.Good, startRevision);
            using (var form = new FormProcess(command))
            {
                form.ShowDialog(this);
                if (form.ErrorOccurred())
                    return;
            }

            command = GitCommandHelpers.ContinueBisectCmd(GitBisectOption.Bad, endRevision);
            FormProcess.ShowDialog(this, command);
        }
开发者ID:Nehle,项目名称:gitextensions,代码行数:13,代码来源:FormBisect.cs

示例5: OkClick

        private void OkClick(object sender, EventArgs e)
        {
            try
            {
                var dirTo = _NO_TRANSLATE_To.Text;
                if (!dirTo.EndsWith(Settings.PathSeparator.ToString()) && !dirTo.EndsWith(Settings.PathSeparatorWrong.ToString()))
                    dirTo += Settings.PathSeparator.ToString();

                dirTo += _NO_TRANSLATE_NewDirectory.Text;

                Repositories.RepositoryHistory.AddMostRecentRepository(_NO_TRANSLATE_From.Text);
                Repositories.RepositoryHistory.AddMostRecentRepository(dirTo);

                var fromProcess =
                    new FormProcess(Settings.GitCommand,
                                    GitCommandHelpers.CloneCmd(_NO_TRANSLATE_From.Text, dirTo,
                                                                     CentralRepository.Checked, null));
                fromProcess.ShowDialog();

                if (fromProcess.ErrorOccurred() || GitCommandHelpers.InTheMiddleOfPatch())
                    return;

                if (ShowInTaskbar == false && AskIfNewRepositoryShouldBeOpened(dirTo))
                {
                    Settings.WorkingDir = dirTo;

                    if (File.Exists(Settings.WorkingDir + ".gitmodules") &&
                        AskIfSubmodulesShouldBeInitialized())
                        InitSubmodules();
                }
                Close();
            }
            catch (Exception ex)
            {
                Trace.WriteLine(ex.Message);
            }
        }
开发者ID:RyanFarley,项目名称:gitextensions,代码行数:37,代码来源:FormClone.cs

示例6: OkClick

        private void OkClick(object sender, EventArgs e)
        {
            try
            {
                Settings.AutoStash = cbAutoStash.Checked;
                var command = "checkout";

                //Get a localbranch name
                if (rbCreateBranch.Checked)
                    command += string.Format(" -b {0}", _newLocalBranchName);
                else if (rbResetBranch.Checked)
                    command += string.Format(" -B {0}", _localBranchName);

                command += " \"" + _branch + "\"";
                bool stashed = CalculateStashedValue();
                var form = new FormProcess(command);
                form.ShowDialog(this);
                if (!form.ErrorOccurred() && stashed)
                {
                    bool messageBoxResult = MessageBox.Show(this, _applyShashedItemsAgain.Text,
                        _applyShashedItemsAgainCaption.Text, MessageBoxButtons.YesNo) == DialogResult.Yes;
                    if (messageBoxResult)
                        new FormProcess("stash pop").ShowDialog(this);
                }
                if (!form.ErrorOccurred())
                    Close();
            }
            catch (Exception ex)
            {
                Trace.WriteLine(ex.Message);
            }
        }
开发者ID:antis81,项目名称:gitextensions,代码行数:32,代码来源:FormCheckoutRemoteBranch.cs

示例7: ShowProcessDialogBox

 private void ShowProcessDialogBox(string source, FormProcess process)
 {
     if (process == null)
         return;
     if (!PullAll())
         process.Remote = source;
     process.ShowDialog(this);
     ErrorOccurred = process.ErrorOccurred();
 }
开发者ID:rschoening,项目名称:gitextensions,代码行数:9,代码来源:FormPull.cs

示例8: PushClick

        private void PushClick(object sender, EventArgs e)
        {
            GitCommands.Settings.WaitUntilAllSettingsLoaded();

            if (PullFromUrl.Checked && string.IsNullOrEmpty(PushDestination.Text))
            {
                MessageBox.Show(_selectDestinationDirectory.Text);
                return;
            }
            if (PullFromRemote.Checked && string.IsNullOrEmpty(Remotes.Text))
            {
                MessageBox.Show(_selectRemote.Text);
                return;
            }
            if (TabControlTagBranch.SelectedTab == TagTab && string.IsNullOrEmpty(TagComboBox.Text) &&
                !PushAllTags.Checked)
            {
                MessageBox.Show(_selectTag.Text);
                return;
            }

            //Extra check if the branch is already known to the remote, give a warning when not.
            //This is not possible when the remote is an URL, but this is ok since most users push to
            //known remotes anyway.
            if (TabControlTagBranch.SelectedTab == BranchTab && PullFromRemote.Checked)
            {
                //The current branch is not known by the remote (as far as we now since we are disconnected....)
                if (!GitCommandHelpers.GetHeads(true, true).Exists(x => x.Remote == Remotes.Text && x.LocalName == RemoteBranch.Text))
                    //Ask if this is what the user wants
                    if (MessageBox.Show(_branchNewForRemote.Text, _pushCaption.Text, MessageBoxButtons.YesNo) ==
                        DialogResult.No)
                        return;
            }

            Repositories.RepositoryHistory.AddMostRecentRepository(PushDestination.Text);

            var remote = "";
            string destination;
            if (PullFromUrl.Checked)
            {
                destination = PushDestination.Text;
            }
            else
            {
                if (GitCommandHelpers.Plink())
                {
                    if (!File.Exists(Settings.Pageant))
                        MessageBox.Show(_cannotLoadPutty.Text, PuttyText);
                    else
                        GitCommandHelpers.StartPageantForRemote(Remotes.Text);
                }

                destination = Remotes.Text;
                remote = Remotes.Text.Trim();
            }

            string pushCmd;
            if (TabControlTagBranch.SelectedTab == BranchTab)
                pushCmd = GitCommands.GitCommandHelpers.PushCmd(destination, Branch.Text, RemoteBranch.Text,
                                                          PushAllBranches.Checked, ForcePushBranches.Checked);
            else
                pushCmd = GitCommands.GitCommandHelpers.PushTagCmd(destination, TagComboBox.Text, PushAllTags.Checked,
                                                             ForcePushBranches.Checked);
            var form = new FormProcess(pushCmd)
                       {
                           Remote = remote,
                           Text = string.Format(_pushToCaption.Text, destination)
                       };

            form.ShowDialog();

            if (!GitCommandHelpers.InTheMiddleOfConflictedMerge() &&
                !GitCommandHelpers.InTheMiddleOfRebase() && !form.ErrorOccurred())
                Close();
        }
开发者ID:xaro,项目名称:gitextensions,代码行数:75,代码来源:FormPush.cs

示例9: OkClick

        private void OkClick(object sender, EventArgs e)
        {
            try
            {
                Settings.MergeAtCheckout = cbMerge.Checked;
                var command = "checkout";

                //Get a localbranch name
                if (rbCreateBranch.Checked)
                    command += string.Format(" -b {0}", _newLocalBranchName);
                else if (rbResetBranch.Checked)
                    command += string.Format(" -B {0}", _localBranchName);

                if (cbMerge.Checked)
                    command += " -m";

                command += " \"" + _branch + "\"";
                var form = new FormProcess(command);
                form.ShowDialog(this);
                if (!form.ErrorOccurred())
                    Close();
            }
            catch (Exception ex)
            {
                Trace.WriteLine(ex.Message);
            }
        }
开发者ID:christruman,项目名称:gitextensions,代码行数:27,代码来源:FormCheckoutRemoteBranch.cs

示例10: ShowProcessDialogBox

 private void ShowProcessDialogBox(IWin32Window owner, string source, FormProcess process)
 {
     if (process == null)
         return;
     if (!IsPullAll())
         process.Remote = source;
     process.ShowDialog(owner);
     ErrorOccurred = process.ErrorOccurred();
 }
开发者ID:eranws,项目名称:gitextensions,代码行数:9,代码来源:FormPull.cs

示例11: okButton_Click

        private void okButton_Click(object sender, EventArgs e)
        {
            try
            {
                var dirTo = this._NO_TRANSLATE_destinationComboBox.Text;
                if (!dirTo.EndsWith(Settings.PathSeparator.ToString()) && !dirTo.EndsWith(Settings.PathSeparatorWrong.ToString()))
                    dirTo += Settings.PathSeparator.ToString();

                dirTo += this._NO_TRANSLATE_subdirectoryTextBox.Text;

                //Repositories.RepositoryHistory.AddMostRecentRepository(_NO_TRANSLATE_From.Text);
                //Repositories.RepositoryHistory.AddMostRecentRepository(dirTo);

                if (!Directory.Exists(dirTo))
                    Directory.CreateDirectory(dirTo);

                var authorsfile = this._NO_TRANSLATE_authorsFileTextBox.Text;
                bool resetauthorsfile = false;
                if (authorsfile != null && authorsfile.Trim().Length != 0 && !File.Exists(authorsfile.Trim()) && !(resetauthorsfile = this.AskContinutWithoutAuthorsFile(authorsfile)))
                {
                    return;
                }
                if (resetauthorsfile)
                {
                    authorsfile = null;
                }
                var fromProcess = new FormProcess(
                    Settings.GitCommand, GitSvnCommandHelpers.CloneCmd(this._NO_TRANSLATE_svnRepositoryComboBox.Text, dirTo, authorsfile));

                fromProcess.ShowDialog(this);

                if (fromProcess.ErrorOccurred() || Settings.Module.InTheMiddleOfPatch())
                    return;
                if (ShowInTaskbar == false && AskIfNewRepositoryShouldBeOpened(dirTo))
                {
                    Settings.WorkingDir = dirTo;
                }
                Close();
            }
            catch (Exception ex)
            {
                MessageBox.Show(this, "Exception: " + ex.Message, "Clone failed", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
开发者ID:nitoyon,项目名称:gitextensions,代码行数:44,代码来源:FormSvnClone.cs

示例12: DoCommit

        private void DoCommit(bool amend, bool push)
        {
            if (Settings.Module.InTheMiddleOfConflictedMerge())
            {
                MessageBox.Show(this, _mergeConflicts.Text, _mergeConflictsCaption.Text, MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
            if (string.IsNullOrEmpty(Message.Text) || Message.Text == commitTemplate)
            {
                MessageBox.Show(this, _enterCommitMessage.Text, _enterCommitMessageCaption.Text, MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                return;
            }

            if (!ValidCommitMessage())
                return;

            if (Settings.Module.GetSelectedBranch().Equals("(no branch)", StringComparison.OrdinalIgnoreCase))
            {
                int idx = PSTaskDialog.cTaskDialog.ShowCommandBox(this,
                                                        _notOnBranchCaption.Text,
                                                        _notOnBranchMainInstruction.Text,
                                                        _notOnBranch.Text,
                                                        _notOnBranchButtons.Text,
                                                        true);
                switch (idx)
                {
                    case 0:
                        string revision = _editedCommit != null ? _editedCommit.Guid : "";
                        if (!GitUICommands.Instance.StartCheckoutBranchDialog(revision))
                            return;
                        break;
                    case -1:
                        return;
                }
            }

            try
            {
                SetCommitMessageFromTextBox(Message.Text);

                ScriptManager.RunEventScripts(ScriptEvent.BeforeCommit);

                var form = new FormProcess(Settings.Module.CommitCmd(amend, signOffToolStripMenuItem.Checked, toolAuthor.Text));
                form.ShowDialog(this);

                NeedRefresh = true;

                if (form.ErrorOccurred())
                    return;

                ScriptManager.RunEventScripts(ScriptEvent.AfterCommit);

                Message.Text = string.Empty;
                GitCommands.Commit.SetCommitMessage(string.Empty);

                if (push)
                {
                    GitUICommands.Instance.StartPushDialog(this, true);
                }

                if (Settings.CloseCommitDialogAfterCommit)
                {
                    Close();
                    return;
                }

                if (Unstaged.GitItemStatuses.Any(gitItemStatus => gitItemStatus.IsTracked))
                {
                    InitializedStaged();
                    return;
                }

                if (Settings.CloseCommitDialogAfterLastCommit)
                    Close();
                else
                    InitializedStaged();
            }
            catch (Exception e)
            {
                MessageBox.Show(this, string.Format("Exception: {0}", e.Message));
            }
        }
开发者ID:Nehle,项目名称:gitextensions,代码行数:82,代码来源:FormCommit.cs

示例13: DoCommit

        private void DoCommit(bool amend, bool push)
        {
            if (GitCommandHelpers.InTheMiddleOfConflictedMerge())
            {
                MessageBox.Show(_mergeConflicts.Text, _mergeConflictsCaption.Text);
                return;
            }
            if (Message.Text.Length < 3)
            {
                MessageBox.Show(_enterCommitMessage.Text, _enterCommitMessageCaption.Text);
                return;
            }

            if (GitCommandHelpers.GetSelectedBranch().Equals("(no branch)", StringComparison.OrdinalIgnoreCase) &&
                MessageBox.Show(_notOnBranch.Text, _notOnBranchCaption.Text, MessageBoxButtons.YesNo) == DialogResult.No)
                return;

            try
            {
                SetCommitMessageFromTextBox(Message.Text);

                var form = new FormProcess(GitCommandHelpers.CommitCmd(amend));
                form.ShowDialog();

                NeedRefresh = true;

                if (form.ErrorOccurred())
                    return;

                Message.Text = string.Empty;

                if (push)
                {
                    GitUICommands.Instance.StartPushDialog(true);
                }

                if (CloseDialogAfterCommit.Checked)
                {
                    Close();
                    return;
                }

                foreach (var gitItemStatus in Unstaged.GitItemStatuses)
                {
                    if (gitItemStatus.IsTracked)
                    {
                        InitializedStaged();
                        return;
                    }
                }

                Close();
            }
            catch (Exception e)
            {
                MessageBox.Show(string.Format("Exception: {0}", e.Message));
            }
        }
开发者ID:xaro,项目名称:gitextensions,代码行数:58,代码来源:FormCommit.cs

示例14: OkClick

        private void OkClick(object sender, EventArgs e)
        {
            try
            {
                var command = "checkout";
                if (Remotebranch.Checked)
                {
                    //Get a localbranch name
                    var remoteName = GitCommandHelpers.GetRemoteName(Branches.Text, GitCommandHelpers.GetRemotes());
                    var localBranchName = Branches.Text.Substring(remoteName.Length + 1);

                    //try to determine the 'best' name for a local branch, check if the local
                    //name for the remote branch is already used
                    if (LocalBranchExists(localBranchName))
                        localBranchName = string.Concat(remoteName, "_", localBranchName);

                    var result = MessageBox.Show(string.Format(trackRemoteBranch.Text, localBranchName), trackRemoteBranchCaption.Text, MessageBoxButtons.YesNoCancel);

                    if (result == DialogResult.Cancel)
                        return;

                    if (result == DialogResult.Yes)
                        command += string.Format(" -b {0}", localBranchName);
                }

                if (Force.Checked)
                    command += " --force";
                command += " \"" + Branches.Text + "\"";
                var form = new FormProcess(command);
                form.ShowDialog();
                if (!form.ErrorOccurred())
                    Close();
            }
            catch (Exception ex)
            {
                Trace.WriteLine(ex.Message);
            }
        }
开发者ID:RyanFarley,项目名称:gitextensions,代码行数:38,代码来源:FormCheckoutBranch.cs

示例15: EvaluateResultsBasedOnSettings

        private bool EvaluateResultsBasedOnSettings(bool stashed, FormProcess process)
        {
            if (!Module.InTheMiddleOfConflictedMerge() &&
                !Module.InTheMiddleOfRebase() &&
                (process != null && !process.ErrorOccurred()))
            {
                InitModules();
                return true;
            }

            // Rebase failed -> special 'rebase' merge conflict
            if (Rebase.Checked && Module.InTheMiddleOfRebase())
            {
                UICommands.StartRebaseDialog(null);
                if (!Module.InTheMiddleOfConflictedMerge() &&
                    !Module.InTheMiddleOfRebase())
                {
                    return true;
                }
            }
            else
            {
                MergeConflictHandler.HandleMergeConflicts(UICommands, this);
                if (!Module.InTheMiddleOfConflictedMerge() &&
                    !Module.InTheMiddleOfRebase())
                {
                    return true;
                }
            }

            if (!AutoStash.Checked || !stashed || Module.InTheMiddleOfConflictedMerge() ||
                Module.InTheMiddleOfRebase())
            {
                return true;
            }
            return false;
        }
开发者ID:eranws,项目名称:gitextensions,代码行数:37,代码来源:FormPull.cs


注:本文中的GitUI.FormProcess.ErrorOccurred方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。