Telerik.Web.Mvc.UI.StyleSheetRegistrar.StyleSheetRegistrar C# (CSharp) Méthode

StyleSheetRegistrar() public méthode

Initializes a new instance of the StyleSheetRegistrar class.
public StyleSheetRegistrar ( WebAssetItemCollection styleSheets, System.Web.Mvc.ViewContext viewContext, IWebAssetItemMerger assetItemMerger ) : System
styleSheets WebAssetItemCollection The style sheets.
viewContext System.Web.Mvc.ViewContext The view context.
assetItemMerger IWebAssetItemMerger The asset merger.
Résultat System
        public StyleSheetRegistrar(WebAssetItemCollection styleSheets, ViewContext viewContext, IWebAssetItemMerger assetItemMerger)
        {
            Guard.IsNotNull(styleSheets, "styleSheets");
            Guard.IsNotNull(viewContext, "viewContext");
            Guard.IsNotNull(assetItemMerger, "assetItemMerger");

            if (viewContext.HttpContext.Items[Key] != null)
            {
                throw new InvalidOperationException(Resources.TextResource.OnlyOneStyleSheetRegistrarIsAllowedInASingleRequest);
            }

            viewContext.HttpContext.Items[Key] = this;

            DefaultGroup = new WebAssetItemGroup("default", false) { DefaultPath = WebAssetDefaultSettings.StyleSheetFilesPath };
            StyleSheets = styleSheets;
            styleSheets.Insert(0, DefaultGroup);

            ViewContext = viewContext;
            AssetMerger = assetItemMerger;

            AssetHandlerPath = WebAssetHttpHandler.DefaultPath;
        }