Inheritance: IProvidersCommonServices
コード例 #1
0
        internal static IComponentPresentationFactory GetComponentPresentationFactory(Localization localization)
        {
            lock (_componentPresentationFactories)
            {
                IComponentPresentationFactory componentPresentationFactory;
                if (!_componentPresentationFactories.TryGetValue(localization.LocalizationId, out componentPresentationFactory))
                {
                    IPublicationResolver publicationResolver = new PublicationResolver(localization);
                    IProvidersCommonServices providersCommonServices = new ProvidersCommonServices(publicationResolver, _logger, _config);
                    IFactoryCommonServices factoryCommonServices = new FactoryCommonServices(publicationResolver, _logger, _config, CreateCacheAgent());
                    componentPresentationFactory = new ComponentPresentationFactory(
                        new TridionComponentPresentationProvider(providersCommonServices), 
                        factoryCommonServices);
                    _componentPresentationFactories.Add(localization.LocalizationId, componentPresentationFactory);
                }

                return componentPresentationFactory;
            }
        }
コード例 #2
0
        internal static IBinaryFactory GetBinaryFactory(Localization localization)
        {
            lock (_binaryFactories)
            {
                IBinaryFactory binaryFactory;
                if (!_binaryFactories.TryGetValue(localization.LocalizationId, out binaryFactory))
                {
                    IPublicationResolver publicationResolver = new PublicationResolver(localization);
                    IProvidersCommonServices providersCommonServices = new ProvidersCommonServices(publicationResolver, _logger, _config);
                    IFactoryCommonServices factoryCommonServices = new FactoryCommonServices(publicationResolver, _logger, _config, CreateCacheAgent());
                    binaryFactory = new BinaryFactory(
                        new TridionBinaryProvider(providersCommonServices),
                        factoryCommonServices);
                    _binaryFactories.Add(localization.LocalizationId, binaryFactory);
                }

                return binaryFactory;
            }
        }