I am writing a visual studio add-in which preforms operations on javascript files after they have been added, removed, renamed and moved. The first 3 events are exposed by ProjectItemsEvents class, along he lines of:
this._applicationObject = (DTE2)application;
this._addInInstance = (AddIn)addInInst;
this.events = _applicationObject.Events as Events2;
this.projectItemsEvents = events.ProjectItemsEvents;
this.projectItemsEvents.ItemRenamed += ProjectItemRenamed;
However, there does not appear to be a way to detect when a file is moved, for instance between solution folders. Performing such an operation does even not appear to result in an ItemRemoved and ItemAdded event as I might expect.
Does anybody know how I should go about detecting the file moved event?
You could use FileSystemWatcher to monitor the solution's directory yourself. When moving a file, it should fire a Deleted event followed by a Created event.