private async Task SetupSolutionEventsSink() { var solution = _accessor.GetService(typeof(SVsSolution)) as IVsSolution; if (solution == null) { await _logger.Error("Can't subscribe to solution events") .ConfigureAwait(false); return; } await _joinableTaskFactory.SwitchToMainThreadAsync(); solution.AdviseSolutionEvents(_eventsSink, out _); }
public VsLogger(ServiceAccessor serviceAccessor, JoinableTaskFactory joinableTaskFactory) { _logger = serviceAccessor.GetService(typeof(SVsActivityLog)) as IVsActivityLog; _joinableTaskFactory = joinableTaskFactory; }