提交 2345ed3d 编写于 作者: P Paul Harrington

Remove private copy of IComWrapper and use the one from the VSSDK

上级 ae7b8758
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
using System.Diagnostics;
using System.Runtime.InteropServices;
using Microsoft.VisualStudio.Shell.Interop;
......@@ -59,7 +60,7 @@ internal static IComWrapper TryGetWrapper(object managedObject)
{
Contract.ThrowIfNull(comWrapper, "comWrapper");
var handle = GCHandle.FromIntPtr(comWrapper.GCHandlePtr);
var handle = GCHandle.FromIntPtr((IntPtr)comWrapper.GCHandlePtr);
var target = handle.Target;
Contract.ThrowIfNull(target, "target");
......@@ -85,7 +86,7 @@ internal static IComWrapper TryGetWrapper(object managedObject)
return null;
}
var handle = GCHandle.FromIntPtr(comWrapper.GCHandlePtr);
var handle = GCHandle.FromIntPtr((IntPtr)comWrapper.GCHandlePtr);
return handle.Target as T;
}
}
......
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
using System.Runtime.InteropServices;
namespace Microsoft.VisualStudio.Shell.Interop
{
// TODO: Remove this definition of IComWrapper and use the one from the VSSDK
// (Microsoft.VisualStudio.Shell.Interop.14.0.DesignTime) when it is available.
[ComImport]
[Guid("CBD71F2C-6BC5-4932-B851-B93EB3151386")]
[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
internal interface IComWrapper
{
IntPtr GCHandlePtr { get; }
}
}
......@@ -369,7 +369,6 @@
<Compile Include="Implementation\InlineRename\InlineRenameUndoManager.cs" />
<Compile Include="Implementation\Interop\ComAggregate.cs" />
<Compile Include="Implementation\Interop\ComHandle.cs" />
<Compile Include="Implementation\Interop\IComWrapper.cs" />
<Compile Include="Implementation\Interop\WeakComHandle.cs" />
<Compile Include="Implementation\Interop\WrapperPolicy.cs" />
<Compile Include="Implementation\LanguageService\AbstractLanguageService.cs" />
......
......@@ -125,6 +125,9 @@
<Reference Include="Microsoft.VisualStudio.Shell.Interop.10.0, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<Reference Include="Microsoft.VisualStudio.Shell.Interop.11.0, Version=11.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<Reference Include="Microsoft.VisualStudio.Shell.Interop.12.0, Version=12.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<Reference Include="Microsoft.VisualStudio.Shell.Interop.14.0.DesignTime, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<EmbedInteropTypes>True</EmbedInteropTypes>
</Reference>
<Reference Include="Microsoft.VisualStudio.Shell.Interop.8.0, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<Reference Include="Microsoft.VisualStudio.Shell.Interop.9.0, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<Reference Include="Microsoft.VisualStudio.Text.Data, Version=$(VisualStudioReferenceAssemblyVersion), Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册