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) {
PopupManager.Show(new CherryPick(repo, commit));
}
///
/// Start pick.
///
///
///
private void Start(object sender, RoutedEventArgs e) {
repo.CherryPick(commitSHA, chkCommitChanges.IsChecked != true);
PopupManager.Close();
}
///
/// Cancel.
///
///
///
private void Cancel(object sender, RoutedEventArgs e) {
PopupManager.Close();
}
}
}