-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Labels
Description
here is the code that is not working
public static IVsWindowFrame open_Document(this string file)
{
try
{
if (file.fileExists().isFalse())
"[open_Document] provided file doesn't exist: {0}".info(file);
else
{
var package = VisualStudio_2010.Package;
var openDoc = package.getService<IVsUIShellOpenDocument>();
IVsWindowFrame frame;
Microsoft.VisualStudio.OLE.Interop.IServiceProvider serviceProvider;
IVsUIHierarchy hierarchy;
uint itemId;
Guid logicalView = VSConstants.LOGVIEWID_Code;
openDoc.OpenDocumentViaProject(file, ref logicalView, out serviceProvider, out hierarchy, out itemId, out frame);
if (frame.notNull())
{
frame.Show();
return frame;
}
"[open_Document] could not get IVsWindowFrame for file: {0}".info(file);
}
}
catch (Exception ex)
{
ex.log("[in file.open_Document]");
}
return null;
}