void OnEntryRemoved(object sender, SolutionItemEventArgs e) { ITreeBuilder tb = Context.GetTreeBuilder(e.SolutionItem); if (tb != null) { tb.Remove(); } }
static void OnEntryAdded(object o, SolutionItemEventArgs args) { if (args is SolutionItemChangeEventArgs && ((SolutionItemChangeEventArgs)args).Reloading) { return; } // 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; Repository currentRepo = GetRepository(entry); if (currentRepo != null && currentRepo.VersionControlSystem != repo.VersionControlSystem) { // If the item is already under version control using a different version control system // don't add it to the parent repo. return; } string path = entry.BaseDirectory; // 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. var files = new HashSet <string> { path }; SolutionItemAddFiles(path, entry, files); using (IProgressMonitor monitor = GetStatusMonitor()) { var status = repo.GetDirectoryVersionInfo(path, false, true); foreach (var v in status) { if (!v.IsVersioned && files.Contains(v.LocalPath)) { repo.Add(v.LocalPath, false, monitor); } } } NotifyFileStatusChanged(new FileUpdateEventArgs(repo, parent.BaseDirectory, true)); }
void OnSolutionItemAddedRemoved(object sender, SolutionItemEventArgs e) { ITreeBuilder tb = Context.GetTreeBuilder(e.Solution); if (tb != null) { tb.Update(); // Update the entry count } }
void OnEntryAdded(object sender, SolutionItemEventArgs e) { ITreeBuilder tb = Context.GetTreeBuilder(e.SolutionItem.ParentFolder); if (tb != null) { tb.AddChild(e.SolutionItem, true); tb.Expanded = true; } }
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; Repository currentRepo = GetRepository(entry); if (currentRepo != null && currentRepo.VersionControlSystem != repo.VersionControlSystem) { // If the item is already under version control using a different version control system // don't add it to the parent repo. return; } string path = entry.BaseDirectory; // 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)); foreach (string p in paths) { if (repo.GetVersionInfo(p).CanAdd) { repo.Add(p, false, monitor); } } } NotifyFileStatusChanged(new FileUpdateEventArgs(repo, parent.BaseDirectory, true)); }
private static void OnEntryAddedToCombine(object sender, SolutionItemEventArgs e) { CProject p = e.SolutionItem as CProject; if (p == null) { return; } foreach (ProjectFile f in p.Files) { TagDatabaseManager.Instance.UpdateFileTags(p, f.Name); } }
protected override void OnSaved(SolutionItemEventArgs args) { base.OnSaved(args); if (ExtendedConfiguration != null) { try { var json = JsonConvert.SerializeObject(ExtendedConfiguration, Newtonsoft.Json.Formatting.Indented); File.WriteAllText(BaseDirectory.Combine(ConfigJson), json); } catch { } } }
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); }
void OnEntryAdded(object sender, SolutionItemEventArgs e) { ITreeBuilder tb; if (e.SolutionItem.ParentFolder == null) { tb = Context.GetTreeBuilder(e.SolutionItem.ParentSolution); } else { tb = Context.GetTreeBuilder(e.SolutionItem.ParentFolder); } if (tb != null) { tb.AddChild(e.SolutionItem, true); } }
private static void OnEntryAddedToCombine(object sender, SolutionItemEventArgs e) { ValaProject p = e.SolutionItem as ValaProject; if (p == null) { return; } foreach (ProjectPackage package in p.Packages) { if (!package.IsProject) { ProjectInformationManager.Instance.Get(p).AddPackage(package.Name); } } foreach (ProjectFile f in p.Files) { ProjectInformationManager.Instance.Get(p).AddFile(f.FilePath); } }
void ProjectSaved(object sender, SolutionItemEventArgs e) { projectSavedHandler(this, new EventArgs()); }
void OnEntryChanged(object sender, SolutionItemEventArgs e) { UpdateTests(); }
void HandleProjectSaved(object sender, SolutionItemEventArgs e) { UpdateCombos(); }
protected override void OnSaved(SolutionItemEventArgs args) { NeedsFullRebuild = true; base.OnSaved(args); }