mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-21 04:04:59 +00:00
refactor<CommitDetail>: move revision files to anthor view
This commit is contained in:
parent
0b6ca9ab8c
commit
bf7cc8eed4
6 changed files with 464 additions and 410 deletions
|
@ -7,9 +7,9 @@ using System.Text.RegularExpressions;
|
|||
namespace SourceGit.Commands {
|
||||
|
||||
/// <summary>
|
||||
/// 取消命令执行的对象
|
||||
/// 用于取消命令执行的上下文对象
|
||||
/// </summary>
|
||||
public class Cancellable {
|
||||
public class Context {
|
||||
public bool IsCancelRequested { get; set; } = false;
|
||||
}
|
||||
|
||||
|
@ -27,6 +27,11 @@ namespace SourceGit.Commands {
|
|||
public string Error { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 上下文
|
||||
/// </summary>
|
||||
public Context Ctx { get; set; } = null;
|
||||
|
||||
/// <summary>
|
||||
/// 运行路径
|
||||
/// </summary>
|
||||
|
@ -42,11 +47,6 @@ namespace SourceGit.Commands {
|
|||
/// </summary>
|
||||
public bool TraitErrorAsOutput { get; set; } = false;
|
||||
|
||||
/// <summary>
|
||||
/// 用于取消命令指行的Token
|
||||
/// </summary>
|
||||
public Cancellable Token { get; set; } = null;
|
||||
|
||||
/// <summary>
|
||||
/// 运行
|
||||
/// </summary>
|
||||
|
@ -69,7 +69,7 @@ namespace SourceGit.Commands {
|
|||
var isCancelled = false;
|
||||
|
||||
proc.OutputDataReceived += (o, e) => {
|
||||
if (Token != null && Token.IsCancelRequested) {
|
||||
if (Ctx != null && Ctx.IsCancelRequested) {
|
||||
isCancelled = true;
|
||||
proc.CancelErrorRead();
|
||||
proc.CancelOutputRead();
|
||||
|
@ -85,7 +85,7 @@ namespace SourceGit.Commands {
|
|||
OnReadline(e.Data);
|
||||
};
|
||||
proc.ErrorDataReceived += (o, e) => {
|
||||
if (Token != null && Token.IsCancelRequested) {
|
||||
if (Ctx != null && Ctx.IsCancelRequested) {
|
||||
isCancelled = true;
|
||||
proc.CancelErrorRead();
|
||||
proc.CancelOutputRead();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue