locked
Access information of "Changeset Details" tool window of Visual Studio 2012 RRS feed

  • Question

  • Greetings!

    I am trying to add a menu item to the contextual menu of the "Changes" section of the tool window "Changeset Details". The menu item needs to have a list of selected files (in the "Changes" section).

    I successfully added the menu item to the tool window "Pending Changes". This menu Item now also appears in "Changeset Details", which makes me think that both tools windows are the same.

    The only problem is that it seems impossible to get the "Changes" items form the "PendingChangesExt" instance I retrieve from the tool window "Changeset Details". The available properties have no items in their collections (ExcludedChanges, IncludedChanges, Items, SelectedItems, etc...)

    So, is there a way to get the list of items under "Changes"? The instance of "PendingChangesExt" is obtained from "VersionControlExt.PendingChanges". Is there another way I should be getting the instance?

    Thanks!
    J-R
    =o)

    P.S.: A little info on my setup

    TFS 2010, Visual Studio 2012 Update 3, Windows 7, Physical computer.

    Tuesday, September 3, 2013 3:29 PM

Answers

  • Hi Goofyb,

    Here is another case which described the same issue as yours. You can try the following code which quoted from that case to see if it helps you:

    ServiceProvider sp = new ServiceProvider((IOleServiceProvider)_applicationObject);
                ITeamExplorer te = sp.GetService(typeof(ITeamExplorer)) as ITeamExplorer;
                IPendingChangesExt pc = te.CurrentPage.GetExtensibilityService(typeof(IPendingChangesExt)) as IPendingChangesExt;
                System.Windows.Forms.MessageBox.Show(pc.SelectedIncludedItems.Length.ToString());
    
    Thanks.

    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    • Marked as answer by Goofyb Friday, September 6, 2013 6:23 PM
    Thursday, September 5, 2013 3:40 PM
    Moderator
  • Hello,

    Well guess what? It works!!!!!

    The object type I was working with was:
    "Microsoft.VisualStudio.TeamFoundation.VersionControl.PendingChangesExt"

    The object type from the code you provided me is:
    "Microsoft.TeamFoundation.VersionControl.Controls.PendingChanges.IPendingChangesExt".

    Thank you very much for your time, it really is appreciated!
    J-R
    =o)


    Friday, September 6, 2013 6:23 PM

All replies

  • Hi Goofyb,

    Thanks for your post.

    In order to get better response, I moved the post to TFS forum.

    Thanks for understanding.

    Best regards


    Sophia Gou <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED> MSDN Community Support Please remember to "Mark as Answer" the responses that resolved your issue.

    Thursday, September 5, 2013 6:49 AM
  • Hi Goofyb,

    Thanks for your post.

    I am trying to involve someone familiar with this topic to further look at this issue. There might be some time delay.

    Appreciate your patience.


    John Qiao [MSFT]
    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    Thursday, September 5, 2013 6:55 AM
    Moderator
  • Hi Goofyb,

    Here is another case which described the same issue as yours. You can try the following code which quoted from that case to see if it helps you:

    ServiceProvider sp = new ServiceProvider((IOleServiceProvider)_applicationObject);
                ITeamExplorer te = sp.GetService(typeof(ITeamExplorer)) as ITeamExplorer;
                IPendingChangesExt pc = te.CurrentPage.GetExtensibilityService(typeof(IPendingChangesExt)) as IPendingChangesExt;
                System.Windows.Forms.MessageBox.Show(pc.SelectedIncludedItems.Length.ToString());
    
    Thanks.

    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    • Marked as answer by Goofyb Friday, September 6, 2013 6:23 PM
    Thursday, September 5, 2013 3:40 PM
    Moderator
  • Hello,

    Well guess what? It works!!!!!

    The object type I was working with was:
    "Microsoft.VisualStudio.TeamFoundation.VersionControl.PendingChangesExt"

    The object type from the code you provided me is:
    "Microsoft.TeamFoundation.VersionControl.Controls.PendingChanges.IPendingChangesExt".

    Thank you very much for your time, it really is appreciated!
    J-R
    =o)


    Friday, September 6, 2013 6:23 PM
  • I was creating a VSPackage to add custom sections into the Pending Changes window as well as the Changeset Details window, and for both of them in my TeamExplorerSection classes I was able to use:

    var _pendingChangesService = this.GetService<Microsoft.TeamFoundation.VersionControl.Controls.Extensibility.IPendingChangesExt>();
    When I do this for the Changeset Details window, the changes show up in the IncludedChanges property.

    - Dan - "Can't never could do anything"



    • Edited by deadlydog Thursday, March 6, 2014 3:50 PM
    Thursday, March 6, 2014 3:46 PM