Exemplo n.º 1
0
        internal SharedServiceFactory(
            SVsServiceProvider serviceProvider,
            [ImportMany]IEnumerable<ISharedServiceVersionFactory> factories)
        {
            var dte = serviceProvider.GetService<SDTE, _DTE>();
            var version = dte.GetVisualStudioVersion();
            var factory = factories.FirstOrDefault(x => x.Version == version);
            if (factory == null)
            {
                factory = new DefaultSharedServiceFactory();
            }

            _factory = factory;
        }
Exemplo n.º 2
0
        internal SharedServiceFactory(
            SVsServiceProvider serviceProvider,
            [ImportMany] IEnumerable <ISharedServiceVersionFactory> factories)
        {
            var dte     = serviceProvider.GetService <SDTE, _DTE>();
            var version = dte.GetVisualStudioVersion();
            var factory = factories.FirstOrDefault(x => x.Version == version);

            if (factory == null)
            {
                factory = new DefaultSharedServiceFactory();
            }

            _factory = factory;
        }
Exemplo n.º 3
0
        internal SharedServiceFactory(
            SVsServiceProvider serviceProvider,
            [ImportMany]IEnumerable<ISharedServiceVersionFactory> factories)
        {
            // TODO: Maybe move the GetService extension method into this project
            var dte = (_DTE)serviceProvider.GetService(typeof(SDTE));
            var version = dte.GetVisualStudioVersion();
            var factory = factories.FirstOrDefault(x => x.Version == version);
            if (factory == null)
            {
                factory = new DefaultSharedServiceFactory();
            }

            _factory = factory;
        }