public void MonitorRepository(string repositoryWorkingPath)
        {
            if (repositoryWorkingPath == null)
            {
                return;
            }
            string gitPath = ModelExtensions.GetGitRepositoryPath(repositoryWorkingPath);

            if (!Directory.Exists(gitPath))
            {
                MonitorForRepositoryCreation(repositoryWorkingPath);
                return;
            }

            _graphBuilder       = _graphBuilderThunk(gitPath);
            Graph               = _graphBuilder.Graph();
            LayoutAlgorithmType = "Tree";

            Refresh();

            MonitorForRepositoryChanges(gitPath);
        }
        public void MonitorRepository(string repositoryWorkingPath)
        {
            if (repositoryWorkingPath == null)
            {
                return;
            }

            string gitPath = ModelExtensions.GetGitRepositoryPath(repositoryWorkingPath);

            _graphBuilder  = _graphBuilderThunk(gitPath);
            RepositoryPath = Directory.GetParent(gitPath).FullName;

            Graph = _graphBuilder.Graph();

            if (!Directory.Exists(gitPath))
            {
                MonitorForRepositoryCreation(RepositoryPath);
            }
            else
            {
                MonitorForRepositoryChanges(gitPath);
            }
        }
 private void MonitorForRepositoryChanges(string gitRepositoryPath)
 {
     ModelExtensions.CreateGitRepositoryChangesObservable(gitRepositoryPath)
     .Subscribe(_ => _uiDispatcher.Invoke(Refresh));
 }
 private void MonitorForRepositoryCreation(string repositoryWorkingPath)
 {
     ModelExtensions.CreateGitRepositoryCreationObservable(repositoryWorkingPath)
     .Subscribe(_ => _uiDispatcher.Invoke(() => MonitorRepository(repositoryWorkingPath)));
 }