Catching files added to a project/solution

Howdy!

I've been trying to figure out how to receive notice when a file is added to a project to no avail. My goal is to run an operation on all new files as they are added, no matter what type of file it might be. I thought AdviseSolutionEvents might have the info I want, but it sounds like it only passes on info about new projects. Does anyone have any advice?

Many thanks,
Matt

[392 byte] By [MattAttaway] at [2007-12-16]
# 1
Hai Matt,
Try this...


applicationObject = (_DTE)application;

EnvDTE.ProjectItemsEvents prjEvts = applicationObject.Events.SolutionItemsEvents;

prjEvts.ItemAdded += new _dispProjectItemsEvents_ItemAddedEventHandler(prjEvts_ItemAdded);




and then....


MessageBox.Show(ProjectItem.Name + " added");


Hope this helps...

HemantKumar at 2007-9-9 > top of Msdn Tech,Visual Studio,Visual Studio Extensibility...
# 2
Hmmm, looks like it is time for me to learn C#. =) Thanks for the help! I'll let you know how it goes.
MattAttaway at 2007-9-9 > top of Msdn Tech,Visual Studio,Visual Studio Extensibility...

Visual Studio

Site Classified