Beispiel #1
0
        private static void RegisterTransforms(DotvvmAmpConfiguration configuration, ILogger logger)
        {
            configuration.ControlTransforms.Register(new AllControlTransform(configuration, logger));

            configuration.ControlTransforms.Register(new DotvvmViewTransform(configuration, logger));
            configuration.ControlTransforms.Register(new HtmlTagTransform(configuration, logger));
            configuration.ControlTransforms.Register(new HeadTagTransform(configuration, logger));
            configuration.ControlTransforms.Register(new BodyTagTransform(configuration, logger));
            configuration.ControlTransforms.Register(new StylesheetLinkTransform(configuration, logger));
            configuration.ControlTransforms.Register(new RouteLinkTransform(configuration, logger));
            configuration.ControlTransforms.Register(new GridViewTransform(configuration, logger));
            configuration.ControlTransforms.Register(new GridViewColumnTransform(configuration, logger));
            configuration.ControlTransforms.Register(new GridViewTextColumnTransform(configuration, logger));
            configuration.ControlTransforms.Register(new GridViewTemplateColumnTransform(configuration, logger));
            configuration.ControlTransforms.Register(new AmpLayoutTransform(configuration, logger));
            configuration.ControlTransforms.Register(new AmpImageTransform(configuration, logger));
            configuration.ControlTransforms.Register(new AmpDecoratorTransform(configuration, logger));
            configuration.ControlTransforms.Register(new RepeaterTransform(configuration, logger));
        }
Beispiel #2
0
        public static void AddDotvvmAmpSupport(this IDotvvmServiceCollection serviceCollection, Action <DotvvmAmpConfiguration, ILogger> modifyConfiguration = null)
        {
            serviceCollection.Services.AddSingleton <IAmpPresenter, DotvvmAmpPresenter>();
            serviceCollection.Services.AddFactory <IAmpStylesheetResourceCollection, AmpStylesheetResourceCollection>();

            serviceCollection.Services.AddSingleton <IAmpOutputRenderer, AmpOutputRenderer>();
            serviceCollection.Services.AddSingleton <IAmpDotvvmViewBuilder, AmpViewBuilder>();
            serviceCollection.Services.AddSingleton <IAmpControlTransformsRegistry, AmpControlTransformsRegistry>();
            serviceCollection.Services.AddSingleton <IAmpValidator, AmpValidator>();
            serviceCollection.Services.AddSingleton <IAmpRouteManager, AmpRouteManager>();
            serviceCollection.Services.AddSingleton <IAmpExternalResourceMetadataCache, AmpExternalResourceMetadataCache>();

            serviceCollection.Services.AddSingleton <DotvvmAmpConfiguration>(provider =>
            {
                var registry     = provider.GetService <IAmpControlTransformsRegistry>();
                var routeManager = provider.GetService <IAmpRouteManager>();
                var logger       = provider.GetService <ILogger>();
                var externalResourceMetadataCache = provider.GetService <IAmpExternalResourceMetadataCache>();
                var config = new DotvvmAmpConfiguration(registry, routeManager, externalResourceMetadataCache);
                RegisterTransforms(config, logger);
                modifyConfiguration?.Invoke(config, logger);
                return(config);
            });
        }
 public AmpLayoutTransform(DotvvmAmpConfiguration ampConfiguration, ILogger logger = null) : base(ampConfiguration, logger)
 {
 }
 public RepeaterTransform(DotvvmAmpConfiguration ampConfiguration, ILogger logger) : base(ampConfiguration, logger)
 {
 }
Beispiel #5
0
 public AmpDecoratorTransform(DotvvmAmpConfiguration ampConfiguration, ILogger logger) : base(ampConfiguration, logger)
 {
 }
Beispiel #6
0
 public InlineStyleTransform(DotvvmAmpConfiguration ampConfiguration, ILogger logger) : base(ampConfiguration, logger)
 {
 }
Beispiel #7
0
 public AllControlTransform(DotvvmAmpConfiguration ampConfiguration, ILogger logger) : base(ampConfiguration, logger)
 {
 }
Beispiel #8
0
 protected GridViewColumnTransformBase(DotvvmAmpConfiguration ampConfiguration, ILogger logger) : base(ampConfiguration, logger)
 {
 }
Beispiel #9
0
 protected AmpControlReplacementTransformBase(DotvvmAmpConfiguration ampConfiguration, ILogger logger = null) : base(ampConfiguration, logger)
 {
 }
Beispiel #10
0
 public DotvvmViewTransform(DotvvmAmpConfiguration ampConfiguration, ILogger logger = null) : base(ampConfiguration, logger)
 {
 }
Beispiel #11
0
 protected ControlTransformBase(DotvvmAmpConfiguration ampConfiguration, ILogger logger)
 {
     this.AmpConfiguration = ampConfiguration;
     this.Logger           = logger;
 }
Beispiel #12
0
 public AmpValidator(DotvvmAmpConfiguration configuration, ILogger <AmpValidator> logger = null)
 {
     this.configuration = configuration;
     this.logger        = logger;
 }
 public AmpStylesheetResourceCollection(IAmpValidator ampValidator, DotvvmAmpConfiguration configuration)
 {
     this.ampValidator  = ampValidator;
     this.configuration = configuration;
 }
 public AmpMetaViewport(DotvvmAmpConfiguration ampConfiguration, ILogger logger = null) : base("meta")
 {
     this.ampConfiguration = ampConfiguration;
     this.logger           = logger;
 }
Beispiel #15
0
 public HeadTagTransform(DotvvmAmpConfiguration ampConfiguration, ILogger logger = null) : base(ampConfiguration, logger)
 {
 }
 public RouteLinkTransform(DotvvmAmpConfiguration ampConfiguration, ILogger logger) : base(ampConfiguration, logger)
 {
 }
Beispiel #17
0
 public GridViewColumnTransform(DotvvmAmpConfiguration ampConfiguration, ILogger logger) : base(ampConfiguration, logger)
 {
 }
 protected ControlValidatorTransformBase(DotvvmAmpConfiguration ampConfiguration, ILogger logger) : base(ampConfiguration, logger)
 {
 }
Beispiel #19
0
 public StylesheetLinkTransform(DotvvmAmpConfiguration ampConfiguration, ILogger logger) : base(ampConfiguration, logger)
 {
 }