void EditRemote(Remote r, string url, string userName, string password) { string oldUrl = r.Url; r.Update(url, userName, password); UpdateRemotes(); if (oldUrl != url) { LibGitNetworkService.GetInstance().UpdateRemote(r.Name, url); } }
void CreateRemote(string name, string url, string userName, string password) { if (CurrentRepositoryRemotes.Any(rr => rr.Name == name)) { MessageBox.Show(Application.Current.MainWindow, "Remote with name " + name + " already exists.", "Error", MessageBoxButton.OK, MessageBoxImage.Error); } else { var r = new List <Remote>() { new Remote(name, url, userName, password) }; SaveRemotes(r.Union(CurrentRemotes).ToList()); LibGitNetworkService.GetInstance().AddRemote(name, url); } }
public RepositoryValidation Clone(string path, string url) { LibGitNetworkService.GetInstance().Clone(path, url); var v = LibGitService.GetInstance().IsValidRepository(path); if (v == RepositoryValidation.Valid) { if (LibGitService.GetInstance().Size(path) > 10000) { var result = MessageBox.Show("Opening repository with more than 10000 commits is not recommended due to slow redrawing. Do you want to open the repository anyways?", "", MessageBoxButton.YesNo, MessageBoxImage.Warning); if (result == MessageBoxResult.No) { return(RepositoryValidation.Valid); } } LibGitService.GetInstance().OpenNewRepository(path); Open(path); } return(v); }
void InitializeCommands() { OnDelete = new RelayCommand(() => LibGitNetworkService.GetInstance().DeleteRemote(Name)); OnEdit = new RelayCommand(() => Program.GetInstance().RemoteManager.EditRemote(this)); }
void OnFetch() { LibGitNetworkService.GetInstance().Fetch(); }
void OnPull() { LibGitNetworkService.GetInstance().Pull(); }
public void RemoveRemote(Remote r) { LibGitNetworkService.GetInstance().RemoveRemote(r.Name); }