示例#1
0
        private ICollection <CResource> GetResources(JsonConfigurarion configuration)
        {
            var list = new List <CResource>();

            if (configuration.ExternalResources.Css != null && configuration.ExternalResources.Css.Any())
            {
                foreach (var css in configuration.ExternalResources.Css.Where(a => a != null).OrderBy(a => a.Order))
                {
                    list.Add(new CResource()
                    {
                        ResourceType = "css",
                        ResourceUrl  = css.Url,
                        IsCdn        = css.IsCdn
                    });
                }
            }
            if (configuration.ExternalResources.Js != null && configuration.ExternalResources.Js.Any())
            {
                foreach (var externalResourcesJ in configuration.ExternalResources.Js.Where(a => a != null).OrderBy(a => a.Order))
                {
                    list.Add(new CResource()
                    {
                        ResourceType = "js",
                        ResourceUrl  = externalResourcesJ.Url,
                        IsCdn        = externalResourcesJ.IsCdn
                    });
                }
            }

            return(list);
        }
示例#2
0
        private string GetContentFromConfiguration(JsonConfigurarion configuration, string directory)
        {
            var file = directory + "/" + configuration.TemplateFullName;

            return(GetTextFromFile(file));
        }