示例#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;
        }
示例#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;
        }