コード例 #1
0
 private IVsIdeScope LoadProjectSystem()
 {
     _safeLogger.LogVerbose("Loading VsIdeScope...");
     try
     {
         MonitorLoadProjectSystem();
         return(VsUtils.ResolveMefDependency <VsIdeScope>(_serviceProvider));
     }
     catch (Exception ex)
     {
         var nullVsProjectSystem = new NullVsIdeScope(_safeLogger, _serviceProvider, _safeMonitoringService);
         ReportErrorServices.ReportInitError(nullVsProjectSystem, ex);
         return(nullVsProjectSystem);
     }
 }
コード例 #2
0
 private IMonitoringService GetSafeMonitoringService(IServiceProvider serviceProvider)
 {
     try
     {
         var safeMonitoringService = VsUtils.ResolveMefDependency <IMonitoringService>(serviceProvider);
         if (safeMonitoringService != null)
         {
             _safeLogger.LogVerbose("Monitoring service loaded");
         }
         return(safeMonitoringService ?? NullVsIdeScope.GetNullMonitoringService());
     }
     catch
     {
         return(NullVsIdeScope.GetNullMonitoringService());
     }
 }