I am trying to write a reference that specifies (among other things) that an item can only be added to either a very particular folder (i got this part by checking the ProjectItem.Name property) OR any folder contained within it. Im having a hard time getting this second part to work. I tried using the Path.GetFullPath() on the ProjectItem to be able to analyze the string returned to see if I am nested inside my particular folder, but this doesnt seem to work as the Path.GetFullPath() call returns back a path to the debug folder....
probably a simple enough question, but Im sick of fighting with it so please help!
thanks in advance.
samm
smartindale
ProjectItem.Properties.Item("FullPath") I believe. Then you just need to check that the item full path starts with the directory you want to ensure is the parent.
Daniel Cazzulino [Solutions Architect MVP]
kzu
cool... thank you.
samm
smartindale
Actually, Im sorry... took me a day or two to get around to coming back to put this back in (i was using get_FileNames(0) just to get it working until i got a response).
putting in your code, i get the error that Properties threw a 'NotImplementedException'
please advise.
thanks
samm
smartindale
If get_FileNames(1) gives you a valid value, then it should be OK. Note that all DTE collections indexes start at 1 :S