Beispiel #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>
        protected override void Initialize()
        {
            Trace.WriteLine(string.Format(CultureInfo.CurrentCulture, "Entering Initialize() of: {0}", this.ToString()));
            base.Initialize();

            Container = VsContainerBuilder.CreateContainer(this);

            var currentIdeIntegration = CurrentIdeIntegration;

            if (currentIdeIntegration != null)
            {
                InstallServices installServices = Container.Resolve <InstallServices>();
                installServices.OnPackageLoad(currentIdeIntegration.Value);
            }

            OleMenuCommandService menuCommandService = GetService(typeof(IMenuCommandService)) as OleMenuCommandService;

            if (menuCommandService != null)
            {
                foreach (var menuCommandHandler in Container.Resolve <IDictionary <SpecFlowCmdSet, MenuCommandHandler> >())
                {
                    menuCommandHandler.Value.RegisterTo(menuCommandService, menuCommandHandler.Key);
                }
            }
        }
Beispiel #2
0
        protected override async Task InitializeAsync(CancellationToken cancellationToken, IProgress <ServiceProgressData> progress)
        {
            Trace.WriteLine(string.Format(CultureInfo.CurrentCulture, "Entering Initialize() of: {0}", this.ToString()));
            base.Initialize();

            Container = VsContainerBuilder.CreateContainer(this);
            TelemetryConfiguration.Active.InstrumentationKey = AppInsightsInstrumentationKey.Key;

            var currentIdeIntegration = CurrentIdeIntegration;

            if (currentIdeIntegration != null)
            {
                InstallServices installServices = Container.Resolve <InstallServices>();
                installServices.OnPackageLoad(currentIdeIntegration.Value);
            }

            OleMenuCommandService menuCommandService = await GetServiceAsync(typeof(IMenuCommandService)) as OleMenuCommandService;

            if (menuCommandService != null)
            {
                foreach (var menuCommandHandler in Container.Resolve <IDictionary <SpecFlowCmdSet, MenuCommandHandler> >())
                {
                    menuCommandHandler.Value.RegisterTo(menuCommandService, menuCommandHandler.Key);
                }
            }

            await base.InitializeAsync(cancellationToken, progress);
        }
 public SpecRunTestRunnerGateway(IOutputWindowService outputWindowService, IIdeTracer tracer, IProjectScopeFactory projectScopeFactory, DTE2 dte, InstallServices installServices)
 {
     this.outputWindowService = outputWindowService;
     this.dte                 = dte;
     this.installServices     = installServices;
     this.projectScopeFactory = projectScopeFactory;
     this.tracer              = tracer;
 }
 public void Setup()
 {
     guidanceNotificationServiceStub = new Mock <IGuidanceNotificationService>();
     ideTracerStub = new Mock <IIdeTracer>();
     fileAssociationDetectorStub         = new Mock <IFileAssociationDetector>();
     statusAccessorStub                  = new Mock <IStatusAccessor>();
     analyticsTransmitterStub            = new Mock <IAnalyticsTransmitter>();
     currentExtensionVersionProviderStub = new Mock <ICurrentExtensionVersionProvider>();
     devBuildCheckerStub                 = new Mock <IDevBuildChecker>();
     sut = new InstallServices(guidanceNotificationServiceStub.Object, ideTracerStub.Object,
                               fileAssociationDetectorStub.Object, statusAccessorStub.Object, analyticsTransmitterStub.Object,
                               currentExtensionVersionProviderStub.Object, devBuildCheckerStub.Object);
 }
        public Vs2008GeneratorServices(Project project) : base(
                new TestGeneratorFactory(), NullIdeTracer.Instance, true)
        {
            this.project = project;

            if (!installerServiceInitialized)
            {
                InstallServices installerService =
                    new InstallServices(new VsBrowserGuidanceNotificationService(project.DTE), tracer,
                                        new WindowsFileAssociationDetector(tracer),
                                        new RegistryStatusAccessor(tracer));

                installerService.OnPackageLoad(IdeIntegration.Install.IdeIntegration.VisualStudio2008);
                installerService.OnPackageUsed();
                installerServiceInitialized = true;
            }
        }
Beispiel #6
0
        public SharpDevelop4GeneratorServices(IProject project) : base(
                new TestGeneratorFactory(), NullIdeTracer.Instance, true)
        {
            this.project = project;

            if (!installerServiceInitialized)
            {
                InstallServices installerService =
                    new InstallServices(new ExternalBrowserGuidanceNotificationService(tracer), tracer,
                                        new WindowsFileAssociationDetector(tracer),
                                        new RegistryStatusAccessor(tracer));

                installerService.OnPackageLoad(IdeIntegration.Install.IdeIntegration.SharpDevelop);
                installerService.OnPackageUsed();
                installerServiceInitialized = true;
            }
        }
 public InstallServicesHelper(InstallServices installServices, DTE dte)
 {
     this.installServices = installServices;
     this.dte             = dte;
 }
 public AutoTestRunnerGateway(IObjectContainer container, InstallServices installServices)
 {
     this.container = container;
     ideIntegration = installServices.IdeIntegration;
 }