Example #1
0
        public void CloneRepository(string path)
        {
            RepositoryClosed();
            TabManager.AddMainTab();
            var v = LibGitService.GetInstance().IsValidRepository(path);

            if (v != RepositoryValidation.Invalid)
            {
                TabManager.CloseAll();
                MessageBox.Show("There is already a repository", "", MessageBoxButton.OK, MessageBoxImage.Error);
                return;
            }
            var dialog = new InputDialog()
            {
                Text = "Enter clone url", Validator = text => true, Owner = Application.Current.MainWindow
            };
            var ans = dialog.ShowDialog();

            if (ans == null || ans == false)
            {
                return;
            }
            v = RepositoryManager.Clone(path, dialog.ResponseText);
            if (v != RepositoryValidation.Valid)
            {
                TabManager.CloseAll();
            }
            else
            {
                Graph.GetInstance().ResetTranslate();
            }
        }
Example #2
0
 void OpenRepository(Func <bool> func)
 {
     RepositoryClosed();
     TabManager.AddMainTab();
     if (!func())
     {
         TabManager.CloseAll();
     }
     else
     {
         Graph.GetInstance().ResetTranslate();
     }
 }
Example #3
0
        public void CreateRepository(string path)
        {
            RepositoryClosed();
            TabManager.AddMainTab();
            var v = RepositoryManager.Create(path);

            if (v != RepositoryValidation.Invalid)
            {
                TabManager.CloseAll();
                MessageBox.Show("There is already a repository", "", MessageBoxButton.OK, MessageBoxImage.Error);
            }
            else
            {
                Graph.GetInstance().ResetTranslate();
            }
        }
Example #4
0
 public void CloseCurrentRepository()
 {
     TabManager.CloseAll();
     RepositoryManager.CloseCurrent();
 }
Example #5
0
 void RepositoryClosed()
 {
     TabManager.CloseAll();
 }