Ejemplo n.º 1
0
        protected override void OnShown(EventArgs e)
        {
            base.OnShown(e);

            gitRepo = repositoryDirectoryController.GetOrAskForRepositoryDirectory();
            if (gitRepo == null)
            {
                // They canceled selecting a repo.
                Environment.Exit(0);
            }

            this.git = new Git(@"git.exe", gitRepo);
            repositoryUpdateThread = new RepositoryUpdateThread(gitRepo, new RepositoryUpdateThread.RepositoryUpdatedDelegate(OnRepositoryUpdateComplete));

            fileSystemWatcher = new FileSystemWatcher(gitRepo, "*.*");
            fileSystemWatcher.IncludeSubdirectories = true;
            fileSystemWatcher.Changed            += FileSystemWatcher_Changed;
            fileSystemWatcher.Created            += FileSystemWatcher_Changed;
            fileSystemWatcher.Deleted            += FileSystemWatcher_Changed;
            fileSystemWatcher.Renamed            += FileSystemWatcher_Changed;
            fileSystemWatcher.EnableRaisingEvents = true;

            PopulateGraph();

            Location = new Point(-10, 0);
            Size     = new Size(796, 488);
        }
Ejemplo n.º 2
0
        private void ChangeRepositoryDirectory()
        {
            string oldGitRepo = gitRepo;
            string directory  = repositoryDirectoryController.AskForRepositoryDirectoryAndSaveIfValid();

            if (directory != null)
            {
                gitRepo = directory;
                if (gitRepo != oldGitRepo)
                {
                    this.git = new Git(@"git.exe", gitRepo);
                    repositoryUpdateThread = new RepositoryUpdateThread(gitRepo, new RepositoryUpdateThread.RepositoryUpdatedDelegate(OnRepositoryUpdateComplete));
                    fileSystemWatcher.Path = gitRepo;
                    PopulateGraph();
                }
            }
        }