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) { var popup = App.GetPopupManager(repo); popup?.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); App.GetPopupManager(repo)?.Close(); } /// /// Cancel /// /// /// private void Cancel(object sender, RoutedEventArgs e) { App.GetPopupManager(repo)?.Close(); } } }