Ejemplo n.º 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 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();
        }
Ejemplo n.º 2
0
        /// <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);
        }
Ejemplo n.º 3
0
        public void GetBuildTypeReturnsItsArgument()
        {
            var configurationName = Guid.NewGuid().ToString();

            Assert.Equal(configurationName, VcProjectService.GetBuildType(configurationName));
        }
Ejemplo n.º 4
0
 public void GetArchitrectureSupportsTheNecessaryArchitectures()
 {
     Assert.Equal("x86", VcProjectService.GetArchitecture("Win32"));
     Assert.Equal("x86_64", VcProjectService.GetArchitecture("x64"));
 }