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


C# FormStatus.ShowDialogOnError方法代码示例

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


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

示例1: stageFile

 private void stageFile(string filename)
 {
     var processStart = new FormStatus.ProcessStart
         (
             delegate(FormStatus form)
             {
                 form.AddOutput(string.Format(stageFilename.Text, filename));
                 string output = Settings.Module.RunCmd
                     (
                     Settings.GitCommand, "add -- \"" + filename + "\""
                     );
                 form.AddOutput(output);
                 form.Done(string.IsNullOrEmpty(output));
             }
         );
     var process = new FormStatus(processStart, null) { Text = string.Format(stageFilename.Text, filename) };
     process.ShowDialogOnError(this);
 }
开发者ID:JTidswell,项目名称:gitextensions,代码行数:18,代码来源:FormResolveConflicts.cs

示例2: Stage

        private void Stage(ICollection<GitItemStatus> gitItemStatusses)
        {
            EnableStageButtons(false);
            try
            {
                Cursor.Current = Cursors.WaitCursor;
                toolStripProgressBar1.Visible = true;
                toolStripProgressBar1.Maximum = gitItemStatusses.Count * 2;
                toolStripProgressBar1.Value = 0;

                var files = new List<GitItemStatus>();

                foreach (var gitItemStatus in gitItemStatusses)
                {
                    toolStripProgressBar1.Value = Math.Min(toolStripProgressBar1.Maximum - 1, toolStripProgressBar1.Value + 1);
                    files.Add(gitItemStatus);
                }

                if (Settings.ShowErrorsWhenStagingFiles)
                {
                    FormStatus.ProcessStart processStart =
                        form =>
                        {
                            form.AddOutput(string.Format(_stageFiles.Text,
                                                         files.Count));
                            var output = GitCommandHelpers.StageFiles(files);
                            form.AddOutput(output);
                            form.Done(string.IsNullOrEmpty(output));
                        };
                    var process = new FormStatus(processStart, null) { Text = _stageDetails.Text };
                    process.ShowDialogOnError();
                }
                else
                {
                    GitCommandHelpers.StageFiles(files);
                }

                InitializedStaged();
                var stagedFiles = (List<GitItemStatus>)Staged.GitItemStatuses;
                var unStagedFiles = (List<GitItemStatus>)Unstaged.GitItemStatuses;
                Unstaged.GitItemStatuses = null;

                unStagedFiles.RemoveAll(item => stagedFiles.Exists(i => i.Name == item.Name || i.OldName == item.Name) && files.Exists(i => i.Name == item.Name));

                Unstaged.GitItemStatuses = unStagedFiles;

                toolStripProgressBar1.Value = toolStripProgressBar1.Maximum;

                toolStripProgressBar1.Visible = false;
            }
            catch (Exception ex)
            {
                Trace.WriteLine(ex.Message);
            }
            EnableStageButtons(true);

            Commit.Enabled = true;
            Amend.Enabled = true;
            AcceptButton = Commit;
            Commit.Focus();
            Cursor.Current = Cursors.Default;

            if (Settings.RevisionGraphShowWorkingDirChanges)
                NeedRefresh = true;
        }
开发者ID:Siorghlas,项目名称:gitextensions,代码行数:65,代码来源:FormCommit.cs

示例3: Stage

        private void Stage(IList<GitItemStatus> gitItemStatusses)
        {
            UnstageFiles.Enabled = false;
            AddFiles.Enabled = false;
            try
            {
                Cursor.Current = Cursors.WaitCursor;
                //Loading.Visible = true;
                progressBar.Visible = true;
                progressBar.Maximum = gitItemStatusses.Count * 2;
                progressBar.Value = 0;

                List<GitItemStatus> files = new List<GitItemStatus>();

                foreach (GitItemStatus gitItemStatus in gitItemStatusses)
                {
                    progressBar.Value = Math.Min(progressBar.Maximum - 1, progressBar.Value + 1);
                    files.Add(gitItemStatus);
                }

                /*OutPut.Text = */
                FormStatus.ProcessStart processStart = new FormStatus.ProcessStart
                    (
                        delegate(FormStatus form)
                        {
                            form.AddOutput(string.Format(stageFiles.Text, files.Count));
                            string output = GitCommands.GitCommands.StageFiles(files);
                            form.AddOutput(output);
                            form.Done(string.IsNullOrEmpty(output));
                        }
                    );
                FormStatus process = new FormStatus(processStart, null);
                process.Text = stageDetails.Text;
                process.ShowDialogOnError();

                InitializedStaged();
                List<GitItemStatus> stagedFiles = (List<GitItemStatus>)Staged.GitItemStatusses;
                List<GitItemStatus> unStagedFiles = (List<GitItemStatus>)Unstaged.GitItemStatusses;
                Unstaged.GitItemStatusses = null;

                unStagedFiles.RemoveAll(item => stagedFiles.Exists(i => i.Name == item.Name));

                Unstaged.GitItemStatusses = unStagedFiles;

                progressBar.Value = progressBar.Maximum;

                //Initialize();
                progressBar.Visible = false;
            }
            catch
            {
            }
            UnstageFiles.Enabled = true;
            AddFiles.Enabled = true;

            Commit.Enabled = true;
            Amend.Enabled = true;
            AcceptButton = Commit;
            Commit.Focus();
        }
开发者ID:alexeik,项目名称:gitextensions,代码行数:60,代码来源:FormCommit.cs

示例4: Stage

        private void Stage(IEnumerable<GitItemStatus> gitItemStatusses)
        {
            EnableStageButtons(false);
            try
            {
                Cursor.Current = Cursors.WaitCursor;
                Unstaged.StoreNextIndexToSelect();
                toolStripProgressBar1.Visible = true;
                toolStripProgressBar1.Maximum = gitItemStatusses.Count() * 2;
                toolStripProgressBar1.Value = 0;

                var files = new List<GitItemStatus>();

                foreach (var gitItemStatus in gitItemStatusses)
                {
                    toolStripProgressBar1.Value = Math.Min(toolStripProgressBar1.Maximum - 1, toolStripProgressBar1.Value + 1);
                    files.Add(gitItemStatus);
                }

                bool wereErrors = false;
                if (Settings.ShowErrorsWhenStagingFiles)
                {
                    FormStatus.ProcessStart processStart =
                        form =>
                        {
                            form.AddMessageLine(string.Format(_stageFiles.Text,
                                                         files.Count));
                            var output = Module.StageFiles(files, out wereErrors);
                            form.AddMessageLine(output);
                            form.Done(string.IsNullOrEmpty(output));
                        };
                    using (var process = new FormStatus(processStart, null) { Text = _stageDetails.Text })
                        process.ShowDialogOnError(this);
                }
                else
                {
                    Module.StageFiles(files, out wereErrors);
                }
                if (wereErrors)
                    RescanChanges();
                else
                {
                    InitializedStaged();
                    var unStagedFiles = (List<GitItemStatus>)Unstaged.GitItemStatuses;
                    Unstaged.GitItemStatuses = null;

                    unStagedFiles.RemoveAll(item => files.Exists(i => i.Name == item.Name || i.OldName == item.Name) && files.Exists(i => i.Name == item.Name));

                    Unstaged.GitItemStatuses = unStagedFiles;
                    Unstaged.SelectStoredNextIndex();
                }

                toolStripProgressBar1.Value = toolStripProgressBar1.Maximum;

                toolStripProgressBar1.Visible = false;
            }
            catch (Exception ex)
            {
                Trace.WriteLine(ex.Message);
            }
            EnableStageButtons(true);

            Commit.Enabled = true;
            Amend.Enabled = true;
            AcceptButton = Commit;
            Cursor.Current = Cursors.Default;

            if (Settings.RevisionGraphShowWorkingDirChanges)
                NeedRefresh = true;
        }
开发者ID:piet-delaney,项目名称:gitextensions,代码行数:70,代码来源:FormCommit.cs

示例5: Stage

        private void Stage(ICollection<GitItemStatus> gitItemStatusses)
        {
            UnstageFiles.Enabled = false;
            AddFiles.Enabled = false;
            try
            {
                Cursor.Current = Cursors.WaitCursor;
                progressBar.Visible = true;
                progressBar.Maximum = gitItemStatusses.Count*2;
                progressBar.Value = 0;

                var files = new List<GitItemStatus>();

                foreach (var gitItemStatus in gitItemStatusses)
                {
                    progressBar.Value = Math.Min(progressBar.Maximum - 1, progressBar.Value + 1);
                    files.Add(gitItemStatus);
                }

                FormStatus.ProcessStart processStart =
                    form =>
                        {
                            form.AddOutput(string.Format(_stageFiles.Text,
                                                         files.Count));
                            var output = GitCommands.GitCommands.StageFiles(files);
                            form.AddOutput(output);
                            form.Done(string.IsNullOrEmpty(output));
                        };
                var process = new FormStatus(processStart, null) {Text = _stageDetails.Text};
                process.ShowDialogOnError();

                InitializedStaged();
                var stagedFiles = (List<GitItemStatus>) Staged.GitItemStatusses;
                var unStagedFiles = (List<GitItemStatus>) Unstaged.GitItemStatusses;
                Unstaged.GitItemStatusses = null;

                unStagedFiles.RemoveAll(item => stagedFiles.Exists(i => i.Name == item.Name) && files.Exists(i => i.Name == item.Name));

                Unstaged.GitItemStatusses = unStagedFiles;

                progressBar.Value = progressBar.Maximum;

                progressBar.Visible = false;
            }
            catch (Exception ex)
            {
                Trace.WriteLine(ex.Message);
            }
            UnstageFiles.Enabled = true;
            AddFiles.Enabled = true;

            Commit.Enabled = true;
            Amend.Enabled = true;
            AcceptButton = Commit;
            Commit.Focus();
        }
开发者ID:meaney,项目名称:gitextensions,代码行数:56,代码来源:FormCommit.cs


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