private void AddFile(string fileName) { string path = Path.GetDirectoryName(fileName); if (!folders.ContainsPath(fileName)) { if (Directory.Exists(path + @"\.svn") || Directory.Exists(path + @"\_svn")) { SvnRepository repo = new SvnRepository(fileName, ScmRepository.PathType.File); folders.Add(repo); listViewFolders.Items.Add(new ListViewItem(fileName, repo.IconName)); UpdateListViewFolderNames(); Config.SaveSvnFolders(folders); UpdateTray(false); BeginUpdateFolderStatuses(); } else { MessageBox.Show("This file is not under SCM", "SCM Notifier", MessageBoxButtons.OK, MessageBoxIcon.Error); } } else { SelectFolder(fileName); } }
public static ScmRepository create(string path) { if (SvnRepository.IsSvnRepositoryDir(path)) { return(new SvnRepository(path, ScmRepository.PathType.Directory)); } if (GitRepository.IsGitRepositoryDir(path)) { return(new GitRepository(path, ScmRepository.PathType.Directory)); } return(null); }
private void AddFile(string fileName) { string path = Path.GetDirectoryName(fileName); if (!folders.ContainsPath(fileName)) { if (Directory.Exists(path + @"\.svn") || Directory.Exists(path + @"\_svn")) { SvnRepository repo = new SvnRepository(fileName, ScmRepository.PathType.File); folders.Add(repo); listViewFolders.Items.Add(new ListViewItem(fileName, repo.IconName)); UpdateListViewFolderNames(); Config.SaveSvnFolders(folders); UpdateTray(false); BeginUpdateFolderStatuses(); } else { MessageBox.Show("This file is not under SCM", "SCM Notifier", MessageBoxButtons.OK, MessageBoxIcon.Error); } } else SelectFolder(fileName); }