using System.Windows; using System.Windows.Controls; namespace SourceGit.UI { /// /// Cherry pick commit dialog. /// public partial class CherryPick : UserControl { private Git.Repository repo = null; private string commitSHA = null; /// /// Constructor. /// /// /// public CherryPick(Git.Repository opened, Git.Commit commit) { InitializeComponent(); repo = opened; commitSHA = commit.SHA; desc.Text = $"{commit.ShortSHA} {commit.Subject}"; } /// /// Display this dialog. /// /// /// public static void Show(Git.Repository repo, Git.Commit commit) { repo.GetPopupManager()?.Show(new CherryPick(repo, commit)); } /// /// Start pick. /// /// /// private void Start(object sender, RoutedEventArgs e) { repo.CherryPick(commitSHA, chkCommitChanges.IsChecked != true); repo.GetPopupManager()?.Close(); } /// /// Cancel. /// /// /// private void Cancel(object sender, RoutedEventArgs e) { repo.GetPopupManager()?.Close(); } } }