private VirtualMemoryNotificationListener( SVsServiceProvider serviceProvider, VisualStudioWorkspace workspace) : base(assertIsForeground: true) { _workspace = workspace; _workspace.WorkspaceChanged += OnWorkspaceChanged; _workspaceCacheService = workspace.Services.GetService<IWorkspaceCacheService>() as WorkspaceCacheService; var shell = (IVsShell)serviceProvider.GetService(typeof(SVsShell)); // Note: We never unhook this event sink. It lives for the lifetime of the host. ErrorHandler.ThrowOnFailure(shell.AdviseBroadcastMessages(this, out var cookie)); }
private VirtualMemoryNotificationListener( SVsServiceProvider serviceProvider, VisualStudioWorkspace workspace) : base(assertIsForeground: true) { _workspace = workspace; _workspace.WorkspaceChanged += OnWorkspaceChanged; _workspaceCacheService = workspace.Services.GetService <IWorkspaceCacheService>() as WorkspaceCacheService; var shell = (IVsShell)serviceProvider.GetService(typeof(SVsShell)); // Note: We never unhook this event sink. It lives for the lifetime of the host. ErrorHandler.ThrowOnFailure(shell.AdviseBroadcastMessages(this, out var cookie)); }
public VirtualMemoryNotificationListener( IThreadingContext threadingContext, SVsServiceProvider serviceProvider, VisualStudioWorkspace workspace) : base(threadingContext, assertIsForeground: true) { _workspace = workspace; _workspaceCacheService = workspace.Services.GetService <IWorkspaceCacheService>() as WorkspaceCacheService; if (GCSettings.IsServerGC) { // Server GC has been explicitly enabled, which tends to run with higher memory pressure than the // default workstation GC. Allow this case without triggering frequent feature shutdown. return; } _workspace.WorkspaceChanged += OnWorkspaceChanged; var shell = (IVsShell)serviceProvider.GetService(typeof(SVsShell)); // Note: We never unhook this event sink. It lives for the lifetime of the host. ErrorHandler.ThrowOnFailure(shell.AdviseBroadcastMessages(this, out var cookie)); }