Exemplo n.º 1
0
 public static LibGitNetworkService GetInstance()
 {
     if (_instance == null)
     {
         _instance = new LibGitNetworkService();
     }
     return(_instance);
 }
Exemplo n.º 2
0
        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);
            }
        }
Exemplo n.º 3
0
 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);
     }
 }
Exemplo n.º 4
0
        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);
        }
Exemplo n.º 5
0
 void InitializeCommands()
 {
     OnDelete = new RelayCommand(() => LibGitNetworkService.GetInstance().DeleteRemote(Name));
     OnEdit   = new RelayCommand(() => Program.GetInstance().RemoteManager.EditRemote(this));
 }
Exemplo n.º 6
0
 void OnFetch()
 {
     LibGitNetworkService.GetInstance().Fetch();
 }
Exemplo n.º 7
0
 void OnPull()
 {
     LibGitNetworkService.GetInstance().Pull();
 }
Exemplo n.º 8
0
 public void RemoveRemote(Remote r)
 {
     LibGitNetworkService.GetInstance().RemoveRemote(r.Name);
 }