using System.Threading.Tasks; namespace SourceGit.Views.Popups { /// /// 遴选面板 /// public partial class CherryPick : Controls.PopupWidget { private string repo = null; private string commit = null; public CherryPick(string repo, Models.Commit commit) { this.repo = repo; this.commit = commit.SHA; InitializeComponent(); txtSHA.Text = commit.ShortSHA; txtCommit.Text = commit.Subject; } public override string GetTitle() { return App.Text("CherryPick.Title"); } public override Task Start() { var noCommits = chkCommit.IsChecked != true; return Task.Run(() => { Models.Watcher.SetEnabled(repo, false); new Commands.CherryPick(repo, commit, noCommits).Exec(); Models.Watcher.SetEnabled(repo, true); return true; }); } } }