Пример #1
0
        public virtual ResourceEntry IncludeBundle(string bundleName, int?order = null, object htmlAttributes = null)
        {
            string bundleUrl = string.Concat(BundleBasePath, bundleName);

            var url = BundleTable.Bundles.ResolveBundleUrl(bundleUrl);

            if (!string.IsNullOrEmpty(url))
            {
                var resourceEntry = new ResourceEntry(ResourceType, url);
                resourcesManager.RegisterResource(resourceEntry);

                if (order.HasValue)
                {
                    resourceEntry.Order = order.Value;
                }

                resourceEntry.HtmlAttributes = htmlAttributes;

                return(resourceEntry);
            }

            throw new UnregisteredBundleException(bundleUrl);
        }
Пример #2
0
        public virtual ResourceEntry Include(string path, bool isThemePath = false, int?order = null, object htmlAttributes = null)
        {
            ResourceEntry resourceEntry;

            if (isThemePath)
            {
                var virtualBasePath = VirtualBasePath.Replace("~/", string.Empty);
                resourceEntry = new ResourceEntry(ResourceType, string.Format("~/Themes/{0}/{1}/{2}", workContext.CurrentDesktopTheme, virtualBasePath, path));
            }
            else
            {
                resourceEntry = new ResourceEntry(ResourceType, string.Concat(VirtualBasePath, "/", path));
            }
            resourcesManager.RegisterResource(resourceEntry);

            if (order.HasValue)
            {
                resourceEntry.Order = order.Value;
            }

            resourceEntry.HtmlAttributes = htmlAttributes;

            return(resourceEntry);
        }
Пример #3
0
 protected abstract string BuildResource(ResourceEntry resource);