public static bool CanAdd(Repository vc, string path) { if (vc.CanAdd(path)) { return(true); } else { return(false); } }
//static void OnFileChanged (object s, ProjectFileEventArgs args) //{ // Repository repo = GetRepository (args.Project); // if (repo != null) // NotifyFileStatusChanged (repo, args.ProjectFile.FilePath, false); //} static void OnFileAdded(object s, ProjectFileEventArgs args) { string path = args.ProjectFile.FilePath; Repository repo = GetRepository(args.Project); if (repo != null && repo.CanAdd(path)) { using (IProgressMonitor monitor = GetStatusMonitor()) { repo.Add(path, false, monitor); } NotifyFileStatusChanged(repo, path, args.ProjectFile.Subtype == Subtype.Directory); } }
static void OnEntryAdded(object o, SolutionItemEventArgs args) { // handles addition of solutions and projects SolutionItem parent = (SolutionItem)args.SolutionItem.ParentFolder; if (parent == null) { return; } Repository repo = GetRepository(parent); if (repo == null) { return; } SolutionItem entry = args.SolutionItem; string path = entry.BaseDirectory; if (!repo.CanAdd(path)) { return; } // While we /could/ call repo.Add with `recursive = true', we don't // necessarily want to add files under the project/solution directory // that may not be a part of this project/solution. ArrayList files = new ArrayList(); files.Add(path); SolutionItemAddFiles(path, entry, files); files.Sort(); using (IProgressMonitor monitor = GetStatusMonitor()) { string[] paths = (string[])files.ToArray(typeof(string)); for (int i = 0; i < paths.Length; i++) { repo.Add(paths[i], false, monitor); } } NotifyFileStatusChanged(repo, parent.BaseDirectory, true); }
public static bool CanAdd (Repository vc, string path) { if (vc.CanAdd(path)) return true; else return false; }