Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Visual Studio.NET / IDE / March 2005

Tip: Looking for answers? Try searching our database.

Double clicking on task item in the Task List window does nothing

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Peter Lee - 18 Mar 2005 00:39 GMT
Visual Studio automatically adds a task item when it see TODO comment. When
you double click on that item, it takes you to place in the file where that
TODO comment came from.

I like to add this behavior to files besides source code files.

I can programmatically add a task item to the Task List. The item has both
the file and the line number. However, when I double click on the task item
in the Task List window, nothing happens. What do I need to do to get the
file to be display when one double clicks on the task item?

Thanks,

Peter.
Gary Chang[MSFT] - 18 Mar 2005 09:41 GMT
Hi Peter,

>I can programmatically add a task item to the Task List. The item has both
>the file and the line number. However, when I double click on the task item
>in the Task List window, nothing happens. What do I need to do to get the
>file to be display when one double clicks on the task item?

First, since the task item has already beed added to the Task List, if you
use that task item's Navagate mathod, will the VS.NET IDE set the correct
focus to the line in the source code that is associated with the task item
specified?

By the way, how do you add a task item to the Task List programmatically ,
would you please give us some code snippet about it?

Thanks!

Best regards,

Gary Chang
Microsoft Community Support
--------------------
Get Secure! ??C www.microsoft.com/security
Register to Access MSDN Managed Newsgroups!
http://support.microsoft.com/default.aspx?scid=/servicedesks/msdn/nospam.asp
&SD=msdn

This posting is provided "AS IS" with no warranties, and confers no rights.
Peter Lee - 18 Mar 2005 17:05 GMT
Gary,

I tried calling the task item's Navigate. However, it does not seem like
this method is implemented. I'm using Visual Studio .NET 2003.

Here is the snippet on how I add the task item.

TaskList taskList =
(TaskList)_appDTE.Windows.Item(Constants.vsWindowKindTaskList).Object;
TaskItem item = taskList.TaskItems.Add("category", "", "description",
vsTaskPriority.vsTaskPriorityMedium,
                       vsTaskIcon.vsTaskIconComment, true, "file", lineNum,
true, true);

File has the full path name to a file in the project. Also, the above code
is called from a wizard.

Thanks,

Peter.

> Hi Peter,
>
[quoted text clipped - 26 lines]
> This posting is provided "AS IS" with no warranties, and confers no
> rights.
Gary Chang[MSFT] - 19 Mar 2005 10:23 GMT
Hi Peter,

I found the exact problem of this issue, the tasklist item you added
programmatically is unable to navigate the caret to the source code line
you specified, please refer to the following paragraph which digested from
the <<Inside Microsoft Visual Studio .NET 2003>> (By Brian Johnson, Craig
Skibo)

The Task List Window /Chapter 10. Programming the User Interface

File and Line
File and Line are a string and integer, respectively, that fill out the
File and Line columns of the Task List. These can contain any values you
want --- they're not used in any way other than for information to display
within the Task List. If the user later performs the default action on the
task (either double-clicking or pressing the Enter key when the task item
is selected), the file won't open and the caret won't be placed on the line
specified in the Line argument. This is because the object model makes no
assumptions about the data in the file; if the file points to a binary
file, opening and placing the caret on a line might not do what you expect;
rather than do something that might be incorrect, it does nothing. However,
you can still connect an event handler onto the task item that was created,
watch for a TaskNavigate event (discussed later), and then manually open
the file using code.

Wish this helps!

Best regards,

Gary Chang
Microsoft Community Support
--------------------
Get Secure! ??C www.microsoft.com/security
Register to Access MSDN Managed Newsgroups!
http://support.microsoft.com/default.aspx?scid=/servicedesks/msdn/nospam.asp
&SD=msdn

This posting is provided "AS IS" with no warranties, and confers no rights.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.