locked
How to publish and raise DTE.Events.SolutionItemsEvents? RRS feed

  • General discussion

  • Hi all,

    I am implementing a project type based on http://mpfproj10.codeplex.com/.

    I find that when I subscribe to DTE.Events.SolutionItemsEvents.ItemAdded/ItemRemoved, I am not actually notified when project items are added or removed. Do I have to raise these events myself in the MPF and how?

    Thank you all.

    Regards


    Zheng Dong

    • Changed type Ego Jiang Thursday, September 20, 2012 9:08 AM
    Wednesday, September 5, 2012 2:02 AM

All replies

  • Events.SolutionEvents contains ProjectAdded and ProjectRemoved

    Wednesday, September 5, 2012 7:08 AM
  • for Project Item added/removed/renamed you should go this way 

    Web Projects/VCProjects has its own objects so this is for no web/vcprojects:

    EnvDTE80.Events2 events2    = (EnvDTE80.Events2VsObject.DTE.Events;
    

    EnvDTE.ProjectItemsEvents_dteProjectItemEvents2 = events2.ProjectItemsEvents;

    jesus

    Wednesday, September 5, 2012 7:26 AM
  • Dear Mathias,

    I would like to publish ProjectItemsEvents so that other users can subscribe to, not to subscribe these events myself. Thank you.

    Regards


    Zheng Dong

    Wednesday, September 5, 2012 8:36 AM
  • Hi VS Anywhere,

    I tries these events (DTE2.Events2.ProjectItemsEvents). They do not work for the project type I created with MPF. I think I have to publish and raise these events myself. I do not figure out how to.

    Regards


    Zheng Dong

    Wednesday, September 5, 2012 8:39 AM
  • Hum, i'm not sure of what you're trying to do.

    Could you please describe the use case ?

    Thanks

    EDIT : Have you created your own project type ?? And you want that env dte gets notified when your project has been added ? If it is a flavored project, there won't be any problems. If nota flavoured project, i've never tried to deal with this, so i don't know if it works with env dte

    I understand now the problem. But you have to know that when you add a project (MPF or classic), this does not raise a itemadded event, but a projectadded event. I'm currenlty working with my own project implementation, and this works well with the correct events i mentionned. ItemsAdded are for other kind of files, not projects

    Use : 

    Events.SolutionEvents

    Not :

    Events.SolutionItemEvents

    
    



    Wednesday, September 5, 2012 8:39 AM
  • Hi Zheng,

    We are changing the issue type to “Comment” because you have not followed up with the necessary information. If you have more time to look at the issue and provide more information, please feel free to change the issue type back to “Question” by editing your initial post and changing the radio button at the top of the post editor window. If the issue is resolved, we will appreciate it if you can share the solution so that the answer can be found and used by other community members having similar questions.

    Best regards,


    Ego [MSFT]
    MSDN Community Support | Feedback to us

    Thursday, September 20, 2012 9:07 AM
  • Just in case other people look for this,...

    Seems the right way is using IVsExtensibility3:

    FireProjectItemsEvent_ItemAdded

    FireProjectItemsEvent_ItemRemoved

    .....

    jesus

    Thursday, March 7, 2013 11:40 PM