/// <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 initialization code that rely on services provided by VisualStudio. /// </summary> protected override async System.Threading.Tasks.Task InitializeAsync(CancellationToken cancellationToken, IProgress <ServiceProgressData> progress) { await base.InitializeAsync(cancellationToken, progress); _dte = await GetServiceAsync <DTE>(); var serviceProvider = new ServiceProvider((Microsoft.VisualStudio.OLE.Interop.IServiceProvider)_dte); var dialogService = new VisualStudioDialogService(serviceProvider); var commandService = await GetServiceAsync <IMenuCommandService>(); var projectService = new VcProjectService(); var settingsService = new VisualStudioSettingsService(this); _solution = await GetServiceAsync <SVsSolution>() as IVsSolution; _solutionEventsHandler = new SolutionEventsHandler(this); _solution.AdviseSolutionEvents(_solutionEventsHandler, out var _solutionEventsCookie); _addConanDepends = new AddConanDepends(commandService, dialogService, projectService, settingsService); _showPackageListCommand = new ShowPackageListCommand(this, commandService, dialogService); _integrateIntoProjectCommand = new IntegrateIntoProjectCommand(commandService, dialogService, projectService); Logger.Initialize(serviceProvider, "Conan"); SubscribeToEvents(); }
/// <summary>Initialization of the package; this method is called right after the package is sited.</summary> protected override void Initialize() { base.Initialize(); var dialogService = new VisualStudioDialogService(this); var commandService = GetService <IMenuCommandService>(); var projectService = new VcProjectService(); var settingsService = new VisualStudioSettingsService(this); _addConanDepends = new AddConanDepends(commandService, dialogService, projectService, settingsService); _showPackageListCommand = new ShowPackageListCommand(this, commandService, dialogService); _integrateIntoProjectCommand = new IntegrateIntoProjectCommand(commandService, dialogService, projectService); }