Пример #1
0
 public ConanOptions(
     IMenuCommandService commandService,
     IErrorListService errorListService,
     OptionsDelegate optionsDelegate)
     : base(commandService, errorListService)
 {
     _optionsDelegate = optionsDelegate;
 }
Пример #2
0
        public MenuCommandBase(IMenuCommandService commandService, IErrorListService errorListService)
        {
            _errorListService = errorListService;
            var menuCommandId = new CommandID(PackageGuids.guidVSConanPackageCmdSet, CommandId);

            _menuCommand = new OleMenuCommand(MenuItemCallback, menuCommandId);
            _menuCommand.BeforeQueryStatus += new EventHandler(OnBeforeQueryStatus);
            commandService.AddCommand(_menuCommand);
        }
Пример #3
0
 public AddConanDependsProject(
     IMenuCommandService commandService,
     IErrorListService errorListService,
     IVcProjectService vcProjectService,
     IConanService conanService) : base(commandService, errorListService)
 {
     _errorListService = errorListService;
     _vcProjectService = vcProjectService;
     _conanService     = conanService;
 }
Пример #4
0
        internal BuildLogger(IApp app, Document doc, ScintillaControl sci, BuildOptions options)
        {
            this.app     = app;
            this.doc     = doc;
            this.sci     = sci;
            this.options = options;

            app.CloseView("ErrorList");
            this.err    = app.GetService <IErrorListService>();
            this.output = app.GetService <IOutputService>();
        }
Пример #5
0
        internal BuildLogger(IApp app, Document doc, ScintillaControl sci, BuildOptions options)
        {
            this.app = app;
            this.doc = doc;
            this.sci = sci;
            this.options = options;

            app.CloseView("ErrorList");
            this.err = app.GetService<IErrorListService>();
            this.output = app.GetService<IOutputService>();
        }
Пример #6
0
 public AddConanDependsConanfile(
     IMenuCommandService commandService,
     IErrorListService errorListService,
     IVcProjectService vcProjectService,
     IConanService conanService) : base(commandService, errorListService)
 {
     _errorListService = errorListService;
     _vcProjectService = vcProjectService;
     _conanService     = conanService;
     _dte2             = Package.GetGlobalService(typeof(SDTE)) as DTE2;
 }
Пример #7
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)
        {
            // Handle commandline switch
            await ThreadHelper.JoinableTaskFactory.SwitchToMainThreadAsync();

            var cmdLine = await GetServiceAsync(typeof(SVsAppCommandLine)) as IVsAppCommandLine;

            ErrorHandler.ThrowOnFailure(cmdLine.GetOption(_cliSwitch, out int isPresent, out string optionValue));
            if (isPresent == 1)
            {
                System.Console.WriteLine(Vsix.Version);
            }

            _dte = await GetServiceAsync <DTE>();

            _solution = await GetServiceAsync <SVsSolution>() as IVsSolution;

            _solutionBuildManager = await GetServiceAsync <IVsSolutionBuildManager>() as IVsSolutionBuildManager3;

            var serviceProvider = new ServiceProvider((Microsoft.VisualStudio.OLE.Interop.IServiceProvider)_dte);

            await TaskScheduler.Default;

            var commandService = await GetServiceAsync <IMenuCommandService>();

            _vcProjectService = new VcProjectService();
            _settingsService  = new VisualStudioSettingsService(this);
            _errorListService = new ErrorListService();
            _conanService     = new ConanService(_settingsService, _errorListService, _vcProjectService);

            await ThreadHelper.JoinableTaskFactory.SwitchToMainThreadAsync();

            _addConanDependsProject  = new AddConanDependsProject(commandService, _errorListService, _vcProjectService, _conanService);
            _addConanDependsSolution = new AddConanDependsSolution(commandService, _errorListService, _vcProjectService, _conanService);

            _conanOptions = new ConanOptions(commandService, _errorListService, ShowOptionPage);
            _conanAbout   = new ConanAbout(commandService, _errorListService);

            await TaskScheduler.Default;

            Logger.Initialize(serviceProvider, "Conan");

            await ThreadHelper.JoinableTaskFactory.SwitchToMainThreadAsync();

            SubscribeToEvents();

            EnableMenus(_dte.Solution != null && _dte.Solution.IsOpen);

            await TaskScheduler.Default;
        }
Пример #8
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>();

            await ThreadHelper.JoinableTaskFactory.SwitchToMainThreadAsync();

            _solution = await GetServiceAsync <SVsSolution>() as IVsSolution;

            _solutionBuildManager = await GetServiceAsync <IVsSolutionBuildManager>() as IVsSolutionBuildManager3;

            var serviceProvider = new ServiceProvider((Microsoft.VisualStudio.OLE.Interop.IServiceProvider)_dte);

            await TaskScheduler.Default;

            var commandService = await GetServiceAsync <IMenuCommandService>();

            _vcProjectService = new VcProjectService();
            _settingsService  = new VisualStudioSettingsService(this);
            _errorListService = new ErrorListService();
            _conanService     = new ConanService(_settingsService, _errorListService, _vcProjectService);

            await ThreadHelper.JoinableTaskFactory.SwitchToMainThreadAsync();

            _solutionEventsHandler = new SolutionEventsHandler(this);
            _solution.AdviseSolutionEvents(_solutionEventsHandler, out var _solutionEventsCookie);

            _addConanDependsProject   = new AddConanDependsProject(commandService, _errorListService, _vcProjectService, _conanService);
            _addConanDependsSolution  = new AddConanDependsSolution(commandService, _errorListService, _vcProjectService, _conanService);
            _addConanDependsConanfile = new AddConanDependsConanfile(commandService, _errorListService, _vcProjectService, _conanService);

            _conanOptions = new ConanOptions(commandService, _errorListService, ShowOptionPage);

            await TaskScheduler.Default;

            Logger.Initialize(serviceProvider, "Conan");

            await ThreadHelper.JoinableTaskFactory.SwitchToMainThreadAsync();

            SubscribeToEvents();

            EnableMenus(_dte.Solution != null && _dte.Solution.IsOpen);

            await TaskScheduler.Default;
        }
Пример #9
0
 public ConanService(ISettingsService settingsService, Core.IErrorListService errorListService, IVcProjectService vcProjectService)
 {
     _settingsService  = settingsService;
     _errorListService = errorListService;
     _vcProjectService = vcProjectService;
 }