Browse Source

Provide a way for the DTE to provide the IVsSolution interface.

Workaround is to have the DTE class implement the System.IServiceProvider interface which is not
actually implemented by Visual Studio's EnvDTE.DTE class.
pull/28/head
Matt Ward 13 years ago
parent
commit
2681f78212
  1. 13
      src/AddIns/Misc/PackageManagement/Project/Src/EnvDTE/DTE.cs

13
src/AddIns/Misc/PackageManagement/Project/Src/EnvDTE/DTE.cs

@ -5,11 +5,13 @@ using System; @@ -5,11 +5,13 @@ using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using Microsoft.VisualStudio.Shell;
using SD = ICSharpCode.SharpDevelop.Project;
namespace ICSharpCode.PackageManagement.EnvDTE
{
public class DTE : MarshalByRefObject, global::EnvDTE.DTE
public class DTE : MarshalByRefObject, global::EnvDTE.DTE, IServiceProvider
{
IPackageManagementProjectService projectService;
IPackageManagementFileService fileService;
@ -83,5 +85,14 @@ namespace ICSharpCode.PackageManagement.EnvDTE @@ -83,5 +85,14 @@ namespace ICSharpCode.PackageManagement.EnvDTE
public global::EnvDTE.SourceControl SourceControl {
get { return null; }
}
/// <summary>
/// HACK - EnvDTE.DTE actually implements Microsoft.VisualStudio.OLE.Interop.IServiceProvider
/// which is COM specific and has a QueryInterface method.
/// </summary>
object IServiceProvider.GetService(Type serviceType)
{
return Package.GetGlobalService(serviceType);
}
}
}

Loading…
Cancel
Save