Пример #1
0
 /// <summary>
 /// Initialization of the package; this method is called right after the package is sited, so this is the place
 /// where you can put all the initilaization code that rely on services provided by VisualStudio.
 /// </summary>
 public static void Initialize(IServiceProvider serviceProvider)
 {
     lock (syncLock)
     {
         try
         {
             if (!initialized)
             {
                 LogWriterFactory.AddVSListeners();
                 if (serviceProvider is Package)
                 {
                     RuntimeHelper.ServiceProvider = serviceProvider;
                     monitor = new ProjectMappingManagerMonitor(serviceProvider, ProjectMappingManager.Instance);
                     LoadAssemblies();
                     InitializeServices(serviceProvider);
                     initialized = true;
                 }
             }
         }
         catch (Exception e)
         {
             Logger.Write(e);
         }
     }
 }