public virtual void Process(VSProjectItemManager manager, string fullFileName, ProjectItem projectItem, string baseFileName, string outputText) { if (manager != null) { manager.AddFileByFileName(baseFileName + this.GetOutputExtension(fullFileName), outputText); } }
public override void Run(string fullFileName, ProjectItem projectItem) { using (var manager = new VSProjectItemManager(this.Chirp.App, projectItem)) { string baseFileName = Utilities.GetBaseFileName(fullFileName, this.Extensions); string inputText = System.IO.File.ReadAllText(fullFileName); string outputText = this.Transform(fullFileName, inputText, projectItem); this.Process(manager, fullFileName, projectItem, baseFileName, outputText); } }
private void ProjectItemsEvents_ItemRenamed(ProjectItem projectItem, string oldFileName) { if (EngineManager.IsTransformed(projectItem.FileName())) { // Now a chirp file this.ProjectItemsEvents_ItemAdded(projectItem); } else if (EngineManager.IsTransformed(oldFileName)) { try { VSProjectItemManager.DeleteAllItems(projectItem.ProjectItems); this.tasks.Remove(oldFileName); } catch (Exception e) { this.OutputWindowWriteText("Exception was thrown when trying to rename file.\n" + e.ToString()); } } }