예제 #1
0
        public static void RenderResources(ResourceManager resourceManager, IHtmlWriter writer, IDotvvmRequestContext context, ResourceRenderPosition position)
        {
            var writeDebugInfo = context.Configuration.Debug;

            foreach (var resource in resourceManager.GetNamedResourcesInOrder())
            {
                if (resource.Resource.RenderPosition == position)
                {
                    if (writeDebugInfo)
                    {
                        WriteResourceInfo(resource, writer, preload: false);
                    }
                    resource.RenderResourceCached(writer, context);
                }
                else if (position == ResourceRenderPosition.Head && resource.Resource.RenderPosition != ResourceRenderPosition.Head && resource.Resource is IPreloadResource preloadResource)
                {
                    if (writeDebugInfo)
                    {
                        WriteResourceInfo(resource, writer, preload: true);
                    }
                    preloadResource.RenderPreloadLink(writer, context, resource.Name);
                }
            }
        }
예제 #2
0
 public static void RenderResources(ResourceManager resourceManager, IHtmlWriter writer, IDotvvmRequestContext context, ResourceRenderPosition position) =>
 RenderResources(resourceManager.GetNamedResourcesInOrder(), writer, context, position);