mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-06-07 11:54:59 +00:00
refactor<*>: rewrite all codes...
This commit is contained in:
parent
89ff8aa744
commit
30ab8ae954
342 changed files with 17208 additions and 19633 deletions
40
src/Views/Popups/AddSubmodule.xaml.cs
Normal file
40
src/Views/Popups/AddSubmodule.xaml.cs
Normal file
|
@ -0,0 +1,40 @@
|
|||
using System.Threading.Tasks;
|
||||
using System.Windows.Controls;
|
||||
|
||||
namespace SourceGit.Views.Popups {
|
||||
/// <summary>
|
||||
/// 新增子模块面板
|
||||
/// </summary>
|
||||
public partial class AddSubmodule : Controls.PopupWidget {
|
||||
private string repo = null;
|
||||
|
||||
public string URL { get; set; }
|
||||
public string Path { get; set; }
|
||||
|
||||
public AddSubmodule(string repo) {
|
||||
this.repo = repo;
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
public override string GetTitle() {
|
||||
return App.Text("Submodule.Add");
|
||||
}
|
||||
|
||||
public override Task<bool> Start() {
|
||||
txtURL.GetBindingExpression(TextBox.TextProperty).UpdateSource();
|
||||
if (Validation.GetHasError(txtURL)) return null;
|
||||
|
||||
txtPath.GetBindingExpression(TextBox.TextProperty).UpdateSource();
|
||||
if (Validation.GetHasError(txtPath)) return null;
|
||||
|
||||
var recursive = chkNested.IsChecked == true;
|
||||
|
||||
return Task.Run(() => {
|
||||
Models.Watcher.SetEnabled(repo, false);
|
||||
var succ = new Commands.Submodule(repo).Add(URL, Path, recursive, UpdateProgress);
|
||||
Models.Watcher.SetEnabled(repo, true);
|
||||
return succ;
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue