I\'m writing my own Visual Studio 2010 Extension that should help me navigating a rather large solution.
I already have a dialog based VS Extension that shows me a class nam
I finally got it...
You just have to use the TextSelection
interface where you have the method MoveToPoint
.
So the code from above is now:
// open the file in a VS code window and activate the pane
Window window = requestedItem.Open(Constants.vsViewKindCode);
window.Activate();
// get the function element and show it
CodeElement function = CodeElementSearcher.GetFunction(requestedItem, myFunctionName);
// get the text of the document
TextSelection textSelection = window.Document.Selection as TextSelection;
// now set the cursor to the beginning of the function
textSelection.MoveToPoint(function.StartPoint);