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