locked
Task List on the tools options dialog RRS feed

  • Question

  • When Visual studio loads you can select Tools->Options under Environment -> Task List tab you can maintain the token list and priority for each token.   They are stored in the registry under the VS version hive.  Visual Studio allows these to be modified while running VS but only saves them back to the registry when it closes down.  How can I access the list that stores the values while Visual Studio is running from my VSPackage?  As the list can change when the session is still running, new items can be added or removed and the priority for any item can be changed. 

    Mark

    Tuesday, September 25, 2012 3:24 PM

Answers

  • EnvDTE.DTE dte = Microsoft.VisualStudio.Shell.Package.GetGlobalService(typeof(EnvDTE.DTE)) as EnvDTE.DTE;

    EnvDTE.Properties prps = dte.Properties["Environment","TaskList"]; 

    foreach (EnvDTE.Property pItm in prps)
    {
         if (pItm.Name.Equals("CommentTokens"))
         {
                 object obj1 = pItm.Value;  // will be an object[] with the tasklist items.

                 ....

    The object array will contain "TODO:2"    the task list item followed by priority 

    1 = Low     2= Normal     3 = High

    • Marked as answer by MarkCooper Wednesday, September 26, 2012 3:33 PM
    Wednesday, September 26, 2012 3:33 PM

All replies

  • EnvDTE.DTE dte = Microsoft.VisualStudio.Shell.Package.GetGlobalService(typeof(EnvDTE.DTE)) as EnvDTE.DTE;

    EnvDTE.Properties prps = dte.Properties["Environment","TaskList"]; 

    foreach (EnvDTE.Property pItm in prps)
    {
         if (pItm.Name.Equals("CommentTokens"))
         {
                 object obj1 = pItm.Value;  // will be an object[] with the tasklist items.

                 ....

    The object array will contain "TODO:2"    the task list item followed by priority 

    1 = Low     2= Normal     3 = High

    • Marked as answer by MarkCooper Wednesday, September 26, 2012 3:33 PM
    Wednesday, September 26, 2012 3:33 PM
  • Hi MarkCooper,

    I’m glad to hear that you got it working.

    Thank you for sharing your solutions & experience here. It will be very beneficial for other community members who have similar questions.

    Best regards,


    Ego [MSFT]
    MSDN Community Support | Feedback to us

    Thursday, September 27, 2012 2:32 AM