using System.Collections.Generic;
using System.Windows;
using System.Windows.Controls;
namespace SourceGit.UI {
///
/// Git save stash panel.
///
public partial class Stash : UserControl {
private Git.Repository repo = null;
private List files = new List();
///
/// Constructor.
///
/// Opened repsitory
public Stash(Git.Repository repo, List files) {
this.repo = repo;
this.files = files;
InitializeComponent();
chkIncludeUntracked.IsEnabled = files.Count == 0;
}
///
/// Open this dialog.
///
/// Opened repository
/// Special files to stash
public static void Show(Git.Repository repo, List files) {
repo.GetPopupManager()?.Show(new Stash(repo, files));
}
///
/// Start saving stash.
///
///
///
private void Start(object sender, RoutedEventArgs e) {
bool includeUntracked = chkIncludeUntracked.IsChecked == true;
string message = txtName.Text;
Git.Stash.Push(repo, includeUntracked, message, files);
repo.GetPopupManager()?.Close();
}
///
/// Cancel
///
///
///
private void Cancel(object sender, RoutedEventArgs e) {
repo.GetPopupManager()?.Close();
}
}
}