Beispiel #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;
        }
        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;
        }