From fbbdde8032911fa33ecc318b913214ce3aa2a643 Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Thu, 15 Sep 2016 16:23:42 -0700 Subject: [PATCH] Delete Azure solution listener --- .../Product/Nodejs/AzureSolutionListener.cs | 128 ------------------ Nodejs/Product/Nodejs/Nodejs.csproj | 1 - 2 files changed, 129 deletions(-) delete mode 100644 Nodejs/Product/Nodejs/AzureSolutionListener.cs diff --git a/Nodejs/Product/Nodejs/AzureSolutionListener.cs b/Nodejs/Product/Nodejs/AzureSolutionListener.cs deleted file mode 100644 index a1422a7e0..000000000 --- a/Nodejs/Product/Nodejs/AzureSolutionListener.cs +++ /dev/null @@ -1,128 +0,0 @@ -//*********************************************************// -// Copyright (c) Microsoft. All rights reserved. -// -// Apache 2.0 License -// -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or -// implied. See the License for the specific language governing -// permissions and limitations under the License. -// -//*********************************************************// - -using System; -using System.Collections.Generic; -using Microsoft.VisualStudio.Shell.Interop; -using Microsoft.VisualStudio; -using ShellConstants = Microsoft.VisualStudio.Shell.Interop.Constants; - -namespace Microsoft.NodejsTools { - class AzureSolutionListener : IVsSolutionEvents3, IDisposable { - public readonly List OpenedHierarchies = new List(); - private readonly IServiceProvider _serviceProvider; - private readonly IVsSolution _solution; - private readonly uint _eventsCookie; - private bool _isDisposed; - - public AzureSolutionListener(IServiceProvider serviceProvider) { - _serviceProvider = serviceProvider; - _solution = _serviceProvider.GetService(typeof(SVsSolution)) as IVsSolution; - ErrorHandler.ThrowOnFailure(_solution.AdviseSolutionEvents(this, out _eventsCookie)); - } - - public int OnAfterOpenProject(IVsHierarchy hierarchy, int added) { - if (added != 0) { - OpenedHierarchies.Add(hierarchy); - } - return VSConstants.E_NOTIMPL; - } - - public int OnAfterCloseSolution(object pUnkReserved) { - return VSConstants.E_NOTIMPL; - } - - public int OnAfterClosingChildren(IVsHierarchy pHierarchy) { - return VSConstants.E_NOTIMPL; - } - - public int OnAfterLoadProject(IVsHierarchy pStubHierarchy, IVsHierarchy pRealHierarchy) { - return VSConstants.E_NOTIMPL; - } - - public int OnAfterMergeSolution(object pUnkReserved) { - return VSConstants.E_NOTIMPL; - } - - public int OnAfterOpenSolution(object pUnkReserved, int fNewSolution) { - return VSConstants.E_NOTIMPL; - } - - public int OnAfterOpeningChildren(IVsHierarchy pHierarchy) { - return VSConstants.E_NOTIMPL; - } - - public int OnBeforeCloseProject(IVsHierarchy pHierarchy, int fRemoved) { - return VSConstants.E_NOTIMPL; - } - - public int OnBeforeCloseSolution(object pUnkReserved) { - return VSConstants.E_NOTIMPL; - } - - public int OnBeforeClosingChildren(IVsHierarchy pHierarchy) { - return VSConstants.E_NOTIMPL; - } - - public int OnBeforeOpeningChildren(IVsHierarchy pHierarchy) { - return VSConstants.E_NOTIMPL; - } - - public int OnBeforeUnloadProject(IVsHierarchy pRealHierarchy, IVsHierarchy pStubHierarchy) { - return VSConstants.E_NOTIMPL; - } - - public int OnQueryCloseProject(IVsHierarchy pHierarchy, int fRemoving, ref int pfCancel) { - return VSConstants.E_NOTIMPL; - } - - public int OnQueryCloseSolution(object pUnkReserved, ref int pfCancel) { - return VSConstants.E_NOTIMPL; - } - - public int OnQueryUnloadProject(IVsHierarchy pRealHierarchy, ref int pfCancel) { - return VSConstants.E_NOTIMPL; - } - - /// - /// The IDispose interface Dispose method for disposing the object determinastically. - /// - public void Dispose() { - Dispose(true); - } - - /// - /// The method that does the cleanup. - /// - /// - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1806:DoNotIgnoreMethodResults", MessageId = "Microsoft.VisualStudio.Shell.Interop.IVsSolution.UnadviseSolutionEvents(System.UInt32)")] - protected virtual void Dispose(bool disposing) { - // Everybody can go here. - if (!_isDisposed) { - // Synchronize calls to the Dispose simulteniously. - lock (this) { - if (disposing && - _eventsCookie != (uint)ShellConstants.VSCOOKIE_NIL && - _solution != null) { - _solution.UnadviseSolutionEvents(_eventsCookie); - } - - _isDisposed = true; - } - } - } - } -} diff --git a/Nodejs/Product/Nodejs/Nodejs.csproj b/Nodejs/Product/Nodejs/Nodejs.csproj index 12da29ffb..7a2e3e859 100644 --- a/Nodejs/Product/Nodejs/Nodejs.csproj +++ b/Nodejs/Product/Nodejs/Nodejs.csproj @@ -528,7 +528,6 @@ -