I have a Visual Studio extension which generates a script file and adds it to the current project.
I want to take advantage of the file preview feature in the Visual Studio 2012 Solution Explorer so that the file is previewed when it is added to the project (instead of actually opening the file).
This is the code I have so far:
UIHierarchy UIH = ((DTE2)dte).ToolWindows.SolutionExplorer;
UIHierarchyItem UIHItem = UIH.GetItem(@"MySolution\MyProject\MyClass.cs");
UIHItem.Select(vsUISelectionType.vsUISelectionTypeSelect);
This selects the item in the Solution Explorer however it does not cause the preview to be shown.
Is there any way to ask VS to show the preview?