VS2013 / Team Explorer vsix - How to get the currently selected build definition?

Greetings,
My goal with a simple extension is to right-click any build definition and if my "Show Build Def Stats" menu item is selected, pop a message box with some summary details I plan to pull from the IBuildDefinition interface.
I'm missing something fundamental I'm sure, but I cannot figure out how in the menu handler the actual build definition that I clicked on.
The menu command is added where I want it successfully:
Symbol info used to get this there:
    <!-- This is the Build Definition Context Menu -->
    <GuidSymbol name="guidTeamExplorerBuildDefContextMenu" value="{34586048-8400-472E-BBBF-3AE30AF8046E}" >
      <IDSymbol name="menuBuildDefinitionContext" value="0x109"/>
    </GuidSymbol>
I am stumped as to how to get the fact that I clicked the "ISRepository" build definition in either the Initialize() or MenuItemCallBack() methods, I haven't come across the right service or container object that I recognize.
Much obliged!
--Jordan

I have been investigating this for a while using .NET Reflector and finally I got it:
In VS 2013, add references to the following assemblies in the folder C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer:
Microsoft.TeamFoundation.Controls.dll
Microsoft.TeamFoundation.Build.Controls.dl
And then use this code:
Microsoft.TeamFoundation.Controls.ITeamExplorer teamExplorer;
Microsoft.TeamFoundation.Controls.ITeamExplorerPage teamExplorerPage;
Microsoft.TeamFoundation.Build.Controls.Extensibility.IBuildsPageExt buildsPageExt;
teamExplorer = base.GetService(typeof(Microsoft.TeamFoundation.Controls.ITeamExplorer)) as Microsoft.TeamFoundation.Controls.ITeamExplorer;
teamExplorerPage = teamExplorer.CurrentPage;
buildsPageExt = teamExplorerPage.GetExtensibilityService(typeof(Microsoft.TeamFoundation.Build.Controls.Extensibility.IBuildsPageExt)) as Microsoft.TeamFoundation.Build.Controls.Extensibility.IBuildsPageExt;
foreach (Microsoft.TeamFoundation.Build.Controls.Extensibility.IDefinitionModel definitionModel in buildsPageExt.SelectedDefinitions)
System.Windows.Forms.MessageBox.Show(definitionModel.Name);
* My new blog about VSX: http://www.visualstudioextensibility.com * Twitter: https://twitter.com/VSExtensibility * MZ-Tools productivity extension for Visual Studio: http://www.mztools.com.

Similar Messages

  • JTree: How to get the currently selected node

    How do I get the currently selected node in JTree?
    getLastSelectedPathComponent() this method always return the last selected node and not the current one.
    Thanks in advance
    Sachin

    Use
    TreePath selectedPath = tree.getSelectionPath()If your tree allows multiple selections, use
    TreePath [] selectedPaths = tree.getSelectionPaths() this will return an array of all selected tree paths.
    Once you get the tree path, call the treePath.getLastPathComponent(). this should tell you the currently selected node.
    Hope this helps
    Sai Pullabhotla

  • How to get the current selected value of a combo box or a option button?

    Hello All,
    I want to catch the current selected value of a combo box and also of a option button and want save it into different variables in my code. These option button and combo box are in a SAP business one form which I have created through VB dot.net coding.
    But I don't know how to do that, can any one send any example code for this.
    Regards,
    Sudeshna.

    Hi Sudesha,
    If you want to get the selected values you can do it as follows: The Combo Box value you can get from the combo box. If you want to get it on the change event, you must make sure that you check when BeforeAction = False. If you want to get an Option Button value you should check the value in the data source attached to the option button.
            Dim oForm As SAPbouiCOM.Form
            Dim oCombo As SAPbouiCOM.ComboBox
            Dim oData As SAPbouiCOM.UserDataSource
            oForm = oApplication.Forms.Item("MyForm")
            oCombo = oForm.Items.Item("myComboUID")
            oApplication.MessageBox(oCombo.Selected.Value)
            oData = oForm.DataSources.UserDataSources.Item("MyDataSourceName")
            oApplication.MessageBox(oData.ValueEx)
    Hope it helps,
    Adele

  • How to get the current selected column and row

    Hi,
    A difficult one, how do i know which column (and row would also be nice) of a JTable is selected?
    e.g.
    I have a JButton which is called "Edit" when i select a cell in the JTable and click the button "Edit" a new window must be visible as a form where the user can edit the a part of a row.
    Then the column which was selected in the JTable must be given (so i need to know current column) and then i want the TextField (the one needed to be edited) be active with requestFocus(). So it would be
    pricetextfield.requestFocus();
    Problem now is that i have to click every time in the window the JTextField which was selected in the JTable. I have chosen for this way of editing because my application is multi-user and it would be too difficult for me when everybody did editing directly (catch signals, reload data, etc.).
    My question is how do I know the current column and the current row in a JTable?

    I'm not sure what your mean by the "current" row or column, but the following utility methods return
    which row and column have focus within the JTable.
    public static int getFocusRow(JTable table) {
        return table.getSelectionModel().getLeadSelectionIndex();
    public static int getFocusColumn(JTable table) {
        return table.getColumnModel().getSelectionModel().getLeadSelectionIndex();
    }

  • How to get the current path of my application in java ?

    how to get the current path of my application in java ?
    thanks

    To get the path where your application has been installed you have to do the following:
    have a class called "what_ever" in the folder.
    then you do a litte:
    String path=
    what_ever.class.getRessource("what_ever.class").toString()
    That get you a string like:
    file:/C:/Program Files/Cool_program/what_ever.class
    Then you process the result a little to remove anything you don't want:
    path=path.substring(path.indexOf('/')+1),path.lastIndexOf('/'))
    //Might be a little error here but you should find out //quickly if it's the case
    And here you go, you have a nice
    C:/Program Files/Cool_program
    which is the path to your application.
    Hooray

  • How to get the current page URL

    HI All
    I am working in oracle apps 4.0
    I have one page called history in that i have one page item called Application url. My application id is 122 but its a copy of application 106
    How to get the current page url for the page item.
    Any steps should be help ful
    Thanks & Regards
    Srikkanth.M

    I'm not 100% clear on what the requirement is from the description, however it does sound like you are making things unnecessarily complicated.
    If you want permanent/ID-independent links then use application and page aliases.
    so here we used to display the url like this: <tt>{noformat}http://81.131.254.171:8080/apex/f?p=122{noformat}</tt>
    Do you mean that the URL is displayed like that? If so that doesn't seem particularly helpful. How is anyone supposed to know what it is?
    There are many ways to provide links in APEX&mdash;including lists and nav bars.
    Where the link is to another resource located on the same server (such as another page in the same app, or a different app in the workspace), relative addressing can be used, making it unecessary to include scheme, domain and port information in the URL. For example, if the page to be linked to has a page alias <tt>ABOUT</tt> in an application with alias <tt>UNITY</tt>, and the apps share an authentication scheme/cookie to permit shared sessions, then the link URL is simply
    f?p=UNITY:ABOUT:&APP_SESSION.

  • How to get the "current date" in the BEx?

    Hi all,
    I need to get the "current date" in my Bex report in order to make a comparison. I know there is a "How to" which shows how to get the current date via a User Exit, but I didn't find it. Could you please help me?
    Thanks

    1. Create a  New Formula in Key Figures structure
    2. Give tech name and description and Select "New variable" option
    3. Next screen will launch Variable Wizard -> create a new variable with replacement path as processing type
    4. in next screene  select the date characteristic that represents the first date to use in the calculation (From Date)
    5. In the next  screen select Key in the Replace Variable with field. Leave all the other options as they are
    6. In the next Currencies and Units screen select Date as the Dimension ID.
    6. Save variable
    repeate the Above steps to create another variable (To Date)
    and now you can use these two new replacement path variables in your new formula.
    Dev

  • How to get the current logical system?

    Dear Abapers:
    I can't find the logical system value from the table SYST, pls tell me how to get the current logical system name, Thanks!

    Hi,
    Check with the table T000, the Logical system field name is LOGSYS.
    Regards
    Thiru

  • How to get the current transaction variant ?

    dear guru,
    could you please tell me how to get the current transaction variant?
    i tried the following method:
      DATA l_tcvariant TYPE tcvariant.
      CALL 'DY_GET_TX_VARIANT'
         ID 'VARIANT' FIELD l_tcvariant.
    but it failed.
    best regards.
    zj

    Try something like this
    DATA:  VARIANT LIKE SHDTVCIU-TCVARIANT.
      CLEAR VARIANT.
      CALL FUNCTION 'RS_HDSYS_GET_TC_VARIANT'
       IMPORTING
         TCVARIANT                     = VARIANT
    *     FLAG_CLIENT_INDEPENDENT       =
    *     RC                            =
    *   TABLES
    *     T_SCREEN_VARIANTS             =
    *     T_INACTIVE_FUNCTIONS          =

  • How to get the Current User on the UI page?

    All,
    Could you please let me know how to get the Current user on the UI input page , i need to display the current user ID when some one clicks the submit button, i want o get the current user to display in the javascript alert box.
    Edited by: 951930 on Oct 24, 2012 12:21 PM

    lucky,
    my schema has already defined for
    <user mapField="USER_ID" default="%CurrentUser"/>
    and in my UI page
    <td oraLabel="user"></td><td oraField="user" id="userId" ></td>
    and my javascript
    function showUserId () {                        
    var curUser = document.getElementById('userId').value;
    alert(curUser);
    and i have called this function on my submit button, but i am not able to get Current Logged User ID value to show in the alert nor able to show the current logged user on the UI page.
    my requirement is on custom UI page i need to show Current Logged User in one corner of the page and also need to show the same user in alert when he submits the button.
    Appreciate for the help.
    Edited by: 951930 on Oct 25, 2012 8:42 AM
    Edited by: 951930 on Oct 25, 2012 9:06 AM

  • How to get the current week from sysdate?

    Hi sir,
    i want to know how to get the current week from sysdate?
    thanks

    Hi Nicolas
    It seems you like to check my post and also make commend ;) thanks for your attention
    Have you ever read the posts above and given solutions ?Yes, I did
    Have you read the docs ? Yes, I checked
    What's the added value here ?Did youYou shared doc with solution(long one), I shared short one which point same solution(Check what Joel posted)..So what is benefit, As you can guess oracle docs are sometimes become so complicated as specialy for beginner...(At least it was like that for me and Belive me somedocs are still sooo complicated even for oracle coworkers ) But for you I dont know ;)
    => Why writting the PS in bold ?Why.. Let me think... Ohh Maybe I am looking some questions(many) and even user get answer they should not changed status so I am reading some posts and try to get problem and loosing time..
    So I am putting that PS wiht BOLD because I dont wanna lose time my friend ;) Because While I am trying to help ppl here In same time I am trying to giving support to my customer prod systems. Which mean time is very important for me...
    Hope my answer could satisfy you..
    One important PS for you.. You may not like my posts (or someone) but my friend I become tired to read&answer and make commend to on your comment which is about my posts.
    I am not newbie in forum(At least I fell like that) and I belive I know how I should make post..
    Thank you
    Regards
    Helios

  • How to get the current schema name

    Hi,
    Can anybody please tell me how to get the current schema name, there is some inbuilt function for this,but i am not getting that. Please help me.
    Thanks
    Jogesh

    ok folks, I found the answer at Tom's as usual.
    http://asktom.oracle.com/tkyte/who_called_me/index.html
    I rewrote it into a function for kicks. just pass the results of DBMS_UTILITY.FORMAT_CALL_STACK to this function and you will get back the owner of the code making the call as well some extra goodies like the name of the code and the type of code depending on the parameter. This ignores the AUTHID CURRENT_USER issues which muddles the schemaid. Quick question, does the average user always have access to DBMS_UTILITY.FORMAT_CALL_STACK or does this get locked down on some systems?
    cheers,
    paul
    create or replace
    FUNCTION SELF_EXAM (
       p_call_stack VARCHAR2,
       p_type VARCHAR2 DEFAULT 'SCHEMA'
    ) RETURN VARCHAR2
    AS
       str_stack   VARCHAR2(4000);
       int_n       PLS_INTEGER;
       str_line    VARCHAR2(255);
       found_stack BOOLEAN DEFAULT FALSE;
       int_cnt     PLS_INTEGER := 0;
       str_caller  VARCHAR2(30);
       str_name    VARCHAR2(30);
       str_owner   VARCHAR2(30);
       str_type    VARCHAR2(30);
    BEGIN
       str_stack := p_call_stack;
       -- Loop through each line of the call stack
       LOOP
         int_n := INSTR( str_stack, chr(10) );
         EXIT WHEN int_cnt = 3 OR int_n IS NULL OR int_n = 0;
         -- get the line
         str_line := SUBSTR( str_stack, 1, int_n - 1 );
         -- remove the line from the stack str
         str_stack := substr( str_stack, int_n + 1 );
         IF NOT found_stack
         THEN
            IF str_line like '%handle%number%name%'
            THEN
               found_stack := TRUE;
            END IF;
         ELSE
            int_cnt := int_cnt + 1;
             -- cnt = 1 is ME
             -- cnt = 2 is MY Caller
             -- cnt = 3 is Their Caller
             IF int_cnt = 1
             THEN
                str_line := SUBSTR( str_line, 22 );
                dbms_output.put_line('->' || str_line);
                IF str_line LIKE 'pr%'
                THEN
                   int_n := LENGTH('procedure ');
                ELSIF str_line LIKE 'fun%'
                THEN
                   int_n := LENGTH('function ');
                ELSIF str_line LIKE 'package body%'
                THEN
                   int_n := LENGTH('package body ');
                ELSIF str_line LIKE 'pack%'
                THEN
                   int_n := LENGTH('package ');
                ELSIF str_line LIKE 'anonymous%'
                THEN
                   int_n := LENGTH('anonymous block ');
                ELSE
                   int_n := null;
                END IF;
                IF int_n IS NOT NULL
                THEN
                   str_type := LTRIM(RTRIM(UPPER(SUBSTR( str_line, 1, int_n - 1 ))));
                 ELSE
                   str_type := 'TRIGGER';
                 END IF;
                 str_line  := SUBSTR( str_line, NVL(int_n,1) );
                 int_n     := INSTR( str_line, '.' );
                 str_owner := LTRIM(RTRIM(SUBSTR( str_line, 1, int_n - 1 )));
                 str_name  := LTRIM(RTRIM(SUBSTR( str_line, int_n + 1 )));
              END IF;
           END IF;
       END LOOP;
       IF UPPER(p_type) = 'NAME'
       THEN
          RETURN str_name;
       ELSIF UPPER(p_type) = 'SCHEMA.NAME'
       OR    UPPER(p_type) = 'OWNER.NAME'
       THEN
          RETURN str_owner || '.' || str_name;
       ELSIF UPPER(p_type) = 'TYPE'
       THEN
          RETURN str_type;
       ELSE
          RETURN str_owner;
       END IF;
    END SELF_EXAM;

  • How to get the current date in a workflow

    Hey,
    Can anyone tell me how to get the current date while in a workflow?
    Thanks in advance.

    Here is how we did it, hope it helps
    <defvar name='locCalendar'>
    <new class='java.util.GregorianCalendar'/>
    </defvar>
    <defvar name='dateFormat'>
    <new class='java.text.SimpleDateFormat'>
              <s>MM/dd/yyyy</s>
         </new>
    </defvar>
    <defvar name='formatedDate'>
         <invoke name='getTime'>
    <ref>locCalendar</ref>
    </invoke>
    </defvar>
    <invoke name='format'>
    <ref>dateFormat</ref>
    <ref>formatedDate</ref>
    </invoke>

  • How to get the current month number

    Hi everyone,
    Does anybody know how to get the current month number in Oracle Discoverer Worksheet calculation?
    I try to use EUL_DATE_TRUNC(CURRENT_DATE, 'MM'), but instead I got 01-AUG-00.
    If I change the data display format to MM, it will give me "08" but if I use TO_NUMBER function to convert it to number I get error "invalid number"
    Is there anyway to get the current month value in number? Thanks

    Scott,
    Thank you so much! It works perfectly! :)
    Hope you have a great day ahead!
    Cheers,
    Angeline

  • How to Get the Current Workitem id at runtime

    Hi All,
    I have a scenario, where request pending with a user who has already resigned the organization. The requirement is that we need to provide a report
    of the request and with whom it is pending with along with the workitem id with a forward push button.
    So that if the user identifies that a request is pending with someone he can click the record and press for the forward button and a pop-up to be showed where he can enter the userid to whom he needs to forward it.
    In this scenario can anyone tell me how to get the current workitem id at run time and to save it to a custom table.
    I tried with method before workitem execution, but here i am not getting the current workitem id.
    Can you please suggest a good solution for this.
    Thanks and Regards,
    Balaji

    Karri,
    I think i can explain you with an example.
    Here is my Scenario.
    A user has raised a Gate pass and it went to all approval's and got approved and the material is also sent out from the plant. Lets take the date as 1.1.2013 (A Warehouse person have done the checking and sent out of the plant).
    On 1.3.2013 some of the material has been returned and a material inward request has been raised and now the warehouse person has to do a inward checking and to sent it back for the initiator for the approval, but the warehouse person has resigned the organization on 1.2.2013, now the workitem is pending with the warehouse person who has already resigned.
    My scenario is once the material inward request is created and before the workitem is delivered to the warehouse person i need to get the workitem id and to store the workitem some where.
    So that in future if any warehouse dept head wants to forward the workitem which are lying in the person inbox who has already resigned he can do it via a report using this workitem id.
    So, can anyone help how to get the dialog workitem id before the workitem creation or execution. I tried with "method before workitem execution" but my break point is not triggering at this point.
    Thanks and Regards,
    Balaji

Maybe you are looking for

  • Need help with the following kernel panic message

    Interval Since Last Panic Report:  343442 sec Panics Since Last Report:          1 Anonymous UUID:                    20AE5901-94AA-497D-A08A-83DE6176E55A Mon May 16 15:17:40 2011 panic(cpu 1 caller 0xffffff80002d1208): Kernel trap at 0xffffff80002c3

  • MDB in cluster, only half recieving messages

    I am running tests on the following scenario; I have a cluster with 4 boxes, all 4 cpu. On each box I run two WLS instances, one on port 8000, the other on port 8010. All instances run in a cluster. I have a separate box running a single JMS server.

  • What is the maximum number of row for a table control in LabWindows/CVI ?

    I use LabWindows CVI 8.5.1 (MMI first developped in version 6.0). In one of our many MMI, a table control contains a list of aircraft parameters. We can add as many parameters (row) as we want but over 40 000 we observe a crash of the LabWindows CVI

  • Solaris- sudo not found

    While configuring the solaris resource adapter on IDM 7,i m getting the following error Test connection failed for resource(s): Solaris: sudo: not found\n I went thru the forum but could not figure where to put the following: /usr/local/bin/sudo inst

  • CProjects 4.0 - Status Report

    Hi all, I have activated the following forms for a project type: <b>DPR_STATUS_REPORT_HTML DPR_STATUS_REPORT_PDF DPR_FORM_STATUS_REPORT</b> Also I have Checked the Status Reports checkbox in the Project type because of which I can see the Status repo