本文整理汇总了C#中GitUI.FormStatus类的典型用法代码示例。如果您正苦于以下问题:C# FormStatus类的具体用法?C# FormStatus怎么用?C# FormStatus使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
FormStatus类属于GitUI命名空间,在下文中一共展示了FormStatus类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Start
public static void Start(FormStatus form)
{
_form = form;
_timer = new Timer(600);
_timer.Elapsed += _timer_Elapsed;
_timer.Enabled = true;
}
示例2: Start
public static void Start(FormStatus form)
{
_form = form;
_timer = new Timer(300);
_timer.Elapsed += new ElapsedEventHandler(_timer_Elapsed);
_timer.Enabled = true;
}
示例3: 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);
}
示例4: 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;
}
示例5: processStart
private void processStart(FormStatus form)
{
BeforeProcessStart();
AddOutput(ProcessString + " " + ProcessArguments);
gitCommand = new GitCommandsInstance { CollectOutput = false };
try
{
Process = gitCommand.CmdStartProcess(ProcessString, ProcessArguments);
gitCommand.Exited += gitCommand_Exited;
gitCommand.DataReceived += gitCommand_DataReceived;
if (!string.IsNullOrEmpty(ProcessInput))
{
Thread.Sleep(500);
Process.StandardInput.Write(ProcessInput);
AddOutput(string.Format(":: Wrote [{0}] to process!\r\n", ProcessInput));
}
}
catch (Exception e)
{
AddOutput(e.Message);
gitCommand.ExitCode = 1;
gitCommand_Exited(null, null);
}
}
示例6: processAbort
private void processAbort(FormStatus form)
{
if (Process != null)
{
Process.Kill();
}
}
示例7: 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;
}
示例8: processStart
private void processStart(FormStatus form)
{
BeforeProcessStart();
string QuotedProcessString = ProcessString;
if (QuotedProcessString.IndexOf(' ') != -1)
QuotedProcessString = QuotedProcessString.Quote();
AddMessageLine(QuotedProcessString + " " + ProcessArguments);
gitCommand = new GitCommandsInstance(WorkingDirectory) { CollectOutput = false };
try
{
Process = gitCommand.CmdStartProcess(ProcessString, ProcessArguments);
gitCommand.Exited += gitCommand_Exited;
gitCommand.DataReceived += gitCommand_DataReceived;
if (!string.IsNullOrEmpty(ProcessInput))
{
Thread.Sleep(500);
Process.StandardInput.Write(ProcessInput);
AddMessageLine(string.Format(":: Wrote [{0}] to process!\r\n", ProcessInput));
}
}
catch (Exception e)
{
AddMessageLine("\n" + e.ToStringWithData());
gitCommand.ExitCode = 1;
gitCommand_Exited(null, null);
}
}
示例9: processAbort
private void processAbort(FormStatus form)
{
if (Process != null)
{
Process.TerminateTree();
}
}
示例10: 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();
}
示例11: processStart
private void processStart(FormStatus form)
{
restart = false;
AddOutput(ProcessString + " " + ProcessArguments);
Plink = GitCommandHelpers.Plink();
gitCommand = new GitCommands.GitCommandsInstance();
gitCommand.CollectOutput = false;
Process = gitCommand.CmdStartProcess(ProcessString, ProcessArguments);
gitCommand.Exited += new EventHandler(gitCommand_Exited);
gitCommand.DataReceived += new DataReceivedEventHandler(gitCommand_DataReceived);
}
示例12: processStart
private void processStart(FormStatus form)
{
restart = false;
AddOutput(ProcessString + " " + ProcessArguments);
Plink = GitCommandHelpers.Plink();
gitCommand = new GitCommands.GitCommandsInstance();
gitCommand.CollectOutput = false;
try
{
Process = gitCommand.CmdStartProcess(ProcessString, ProcessArguments);
gitCommand.Exited += new EventHandler(gitCommand_Exited);
gitCommand.DataReceived += new DataReceivedEventHandler(gitCommand_DataReceived);
}
catch (Exception e)
{
AddOutput(e.Message);
gitCommand.ExitCode = 1;
gitCommand_Exited(null, null);
}
}
示例13: 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();
}
示例14: processStart
private void processStart(FormStatus form)
{
BeforeProcessStart();
string QuotedProcessString = ProcessString;
if (QuotedProcessString.IndexOf(' ') != -1)
QuotedProcessString = QuotedProcessString.Quote();
AddMessageLine(QuotedProcessString + " " + ProcessArguments);
try
{
ConsoleOutput.StartProcess(ProcessString, ProcessArguments, WorkingDirectory);
if (!string.IsNullOrEmpty(ProcessInput))
{
throw new NotSupportedException("No non-NULL usages of ProcessInput are currently expected."); // Not implemented with all terminal variations, so let's postpone until there's at least one non-null case
/*
Thread.Sleep(500);
Process.StandardInput.Write(ProcessInput);
AddMessageLine(string.Format(":: Wrote [{0}] to process!\r\n", ProcessInput));
*/
}
}
catch (Exception e)
{
AddMessageLine("\n" + e.ToStringWithData());
OnExit(1);
}
}
示例15: processAbort
private void processAbort(FormStatus form)
{
ConsoleOutput.KillProcess();
}