public VsProjectReferencesTracker(Project project, DteWithEvents dteWithEvents, IIdeTracer tracer) { this.project = project.Object as VSProject; this.dteWithEvents = dteWithEvents; this.tracer = tracer; this.timer = new Timer(HandleFilesChangedOnDisk, null, Timeout.Infinite, Timeout.Infinite); this.triggerReferenceChangedTimer = new Timer(TriggerReferenceChange, null, Timeout.Infinite, Timeout.Infinite); }
protected VsProjectFileTrackerBase(Project project, DteWithEvents dteWithEvents, IIdeTracer tracer) { this.project = project; this.dteWithEvents = dteWithEvents; this.tracer = tracer; this.timer = new Timer(HandleFilesChangedOnDisk, null, Timeout.Infinite, Timeout.Infinite); }
public VsProjectFileTracker(Project project, string fileName, DteWithEvents dteWithEvents, IVisualStudioTracer tracer, bool followTrackingAfterRename = false) : base(project, dteWithEvents, tracer) { this.followTrackingAfterRename = followTrackingAfterRename; this.fileName = fileName; SetLastChangeDate(VsxHelper.FindProjectItemByProjectRelativePath(project, fileName)); SubscribeToDteEvents(); }
public VsProjectFileTracker(Project project, string fileName, DteWithEvents dteWithEvents, IVisualStudioTracer visualStudioTracer, bool followTrackingAfterRename = false) { this.project = project; this.followTrackingAfterRename = followTrackingAfterRename; this.fileName = fileName; this.visualStudioTracer = visualStudioTracer; SetLastChangeDate(VsxHelper.FindProjectItemByProjectRelativePath(project, fileName)); SubscribeToDteEvents(dteWithEvents); }
public VsProjectFileTracker(ProjectItem projectItem, DteWithEvents dteWithEvents, IVisualStudioTracer visualStudioTracer, bool followTrackingAfterRename = false) : this(projectItem.ContainingProject, VsxHelper.GetProjectRelativePath(projectItem), dteWithEvents, visualStudioTracer, followTrackingAfterRename) { }
private void SubscribeToDteEvents(DteWithEvents dteWithEvents) { dteWithEvents.ProjectItemsEvents.ItemAdded += item => { visualStudioTracer.Trace("Item Added: " + item.Name, "VsProjectFileTracker"); if (IsItemRelevant(item)) { OnFileChanged(item); } }; dteWithEvents.ProjectItemsEvents.ItemRemoved += item => { visualStudioTracer.Trace("Item Removed: " + item.Name, "VsProjectFileTracker"); if (IsItemRelevant(item)) { OnFileChanged(null); } }; dteWithEvents.ProjectItemsEvents.ItemRenamed += (item, oldName) => { visualStudioTracer.Trace("Item Renamed to: " + item.Name + " from " + oldName, "VsProjectFileTracker"); if (IsItemRelevant(item)) { OnFileChanged(item); } else if (IsItemRelevant(item, oldName)) { if (followTrackingAfterRename) { fileName = VsxHelper.GetProjectRelativePath(item); OnFileChanged(item); } else { OnFileChanged(null); } } }; dteWithEvents.DocumentEvents.DocumentSaved += document => { visualStudioTracer.Trace("Document Saved: " + document, "VsProjectFileTracker"); ProjectItem item = document.ProjectItem; if (IsItemRelevant(item)) { OnFileChanged(item); } }; dteWithEvents.BuildEvents.OnBuildDone += (scope, action) => { this.visualStudioTracer.Trace("Build Done.", "VsProjectFileTracker"); ProjectItem item = VsxHelper.FindProjectItemByProjectRelativePath(project, fileName); var newChangeDate = GetLastChangeDate(item); if (newChangeDate != LastChangeDate) { OnFileChanged(item); } }; }
protected VsProjectFileTrackerBase(Project project, DteWithEvents dteWithEvents, IVisualStudioTracer visualStudioTracer) { this.project = project; this.dteWithEvents = dteWithEvents; this.visualStudioTracer = visualStudioTracer; }
public VsProjectFilesTracker(Project project, string regexPattern, DteWithEvents dteWithEvents, IVisualStudioTracer visualStudioTracer) : base(project, dteWithEvents, visualStudioTracer) { fileNameRe = new Regex(regexPattern, RegexOptions.IgnoreCase); SubscribeToDteEvents(); }
public VsProjectFilesTracker(Project project, string regexPattern, DteWithEvents dteWithEvents, IIdeTracer tracer) : base(project, dteWithEvents, tracer) { fileNameRe = new Regex(regexPattern, RegexOptions.IgnoreCase); SubscribeToDteEvents(); }