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.Content = $"{commit.ShortSHA} {commit.Subject}"; } /// /// Display this dialog. /// /// /// public static void Show(Git.Repository repo, Git.Commit commit) { var popup = App.GetPopupManager(repo); popup?.Show(new CherryPick(repo, commit)); } /// /// Start pick. /// /// /// private void Start(object sender, RoutedEventArgs e) { repo.CherryPick(commitSHA, chkCommitChanges.IsChecked != true); var popup = App.GetPopupManager(repo); popup?.Close(); } /// /// Cancel. /// /// /// private void Cancel(object sender, RoutedEventArgs e) { var popup = App.GetPopupManager(repo); popup?.Close(); } } }