Example #1
0
        private void ConfigurePackageServices()
        {
            var platformServices = new VsPlatformServices();

            var componentModel     = (IComponentModel)VsPackage.GetGlobalService(typeof(SComponentModel));
            var compositionCatalog = new CompositionCatalog(componentModel.DefaultCompositionService, componentModel.DefaultExportProvider);
            var exportProvider     = componentModel.DefaultExportProvider;

            _services
            .AddService(componentModel)
            .AddService(componentModel.DefaultCompositionService)
            .AddService(exportProvider)
            .AddService(compositionCatalog)
            .AddService(new VsUIServices(this))
            .AddService(new VsPlotExportDialog(this))
            .AddService(platformServices)
            .AddService <IEditorSupport, VsEditorSupport>()
            .AddService <IImageService, ImageService>()
            .AddService(new REditorSettings(this))
            .AddService(new RMarkdownEditorSettings(this))
            .AddService <IStatusBar, VsStatusBar>()
            .AddService <RPackageToolWindowProvider>()
            .AddRComponentsServices()
            .AddWindowsRInterpretersServices()
            .AddWindowsHostClientServices()
            .AddWindowsRComponentsServices()
            .AddEditorServices()
            .AddWindowsContainerServices();
            // TODO: add more

            _application = new VsApplication(_services);
            _services.AddService(_application);
            _services.GetService <IRSettings>().LoadSettings();
        }
Example #2
0
        private void ConfigureServices()
        {
            var platformServices   = new VsPlatformServices();
            var telemetry          = new VsTelemetryService();
            var componentModel     = (IComponentModel)VsPackage.GetGlobalService(typeof(SComponentModel));
            var loggingPermissions = new LoggingPermissions(platformServices, telemetry, new RegistryImpl());
            var settings           = new RToolsSettingsImplementation(this, new VsSettingsStorage(), loggingPermissions);
            var compositionCatalog = new CompositionCatalog(componentModel.DefaultCompositionService, componentModel.DefaultExportProvider);
            var exportProvider     = componentModel.DefaultExportProvider;

            _services
            .AddService(componentModel)
            .AddService(componentModel.DefaultCompositionService)
            .AddService(exportProvider)
            .AddService(compositionCatalog)
            .AddService(new VsMainThread())
            .AddService(new VsTaskService())
            .AddService(_idleTimeService)
            .AddService(new VsUIServices(this))
            .AddService(new SecurityService(this))
            .AddService(loggingPermissions)
            .AddService(new Logger(ApplicationName, Path.GetTempPath(), loggingPermissions))
            .AddService(platformServices)
            .AddService(settings)
            .AddService(new REditorSettings(new LanguageSettingsStorage(this, RGuidList.RLanguageServiceGuid, RGuidList.RPackageGuid, new string[] { RPackage.ProductName })))
            .AddService(new ImageService(exportProvider.GetExportedValue <IGlyphService>()))
            .AddService(new VsEditorSupport(this))
            .AddService(telemetry)
            .AddService(new FileSystem())
            .AddService(new ProcessServices())
            .AddService(new RegistryImpl())
            .AddService(new MicrosoftRClientInstaller())
            .AddWindowsRInterpretersServices()
            .AddWindowsHostClientServices();
            // TODO: add more

            settings.LoadSettings();
        }