Exemplo n.º 1
0
        /// <summary>
        /// Registers the client resources that should be injected on page to enable Disqus comments.
        /// </summary>
        /// <param name="requiredResources">The required resources.</param>
        /// <param name="context">The context.</param>
        /// <param name="renderingModel">The rendering model.</param>
        private void RegisterClientResources(IRequiredClientResourceList requiredResources, IContext context, RenderingModel renderingModel)
        {
            if (!renderingModel.IsEnabled && !context.IsInEditMode)
            {
                return;
            }

            requiredResources.RequireScriptInline(renderingModel.LoaderScript, "duk-disqus.Loader", null).AtFooter();

            if ((context.IsInEditMode || context.IsInPreviewMode) && _editModeRendering.Value != null)
            {
                // Do specific injections for Edit UI
                _editModeRendering.Value.RegisterClientResources(requiredResources, renderingModel);
            }
        }