Пример #1
0
 public AmpKeyframesStylesheetResource(IAmpStylesheetResourceCollection ampStylesheetResourceCollection) : base(ResourceRenderPosition.Body)
 {
     resources = ampStylesheetResourceCollection;
 }
        private IEnumerable <NamedResource> ProcessNamedResource(NamedResource namedResource, IAmpStylesheetResourceCollection ampStylesheetResourceCollection)
        {
            var resource = namedResource.Resource;

            var isMerged = false;

            if (resource is StylesheetResource stylesheetResource)
            {
                ampStylesheetResourceCollection.Add(stylesheetResource.Location);
                isMerged = true;
            }
            else if (resource is InlineStylesheetResource inlineStylesheetResource)
            {
                ampStylesheetResourceCollection.Add(new InlineResourceLocation(inlineStylesheetResource.Code));
                isMerged = true;
            }

            if (!isMerged)
            {
                yield return(namedResource);
            }
        }
Пример #3
0
 public AmpCustomStylesheetResource(IAmpStylesheetResourceCollection ampStylesheetResourceCollection) : base(
         ResourceRenderPosition.Head)
 {
     resources = ampStylesheetResourceCollection;
 }