Esempio n. 1
0
        public void Load()
        {
            if (!Directory.Exists(ThemeRoot))
            {
                throw new DirectoryNotFoundException(string.Format("Cannot find the theme '{0}' in the site themes '{1}'", Name, ThemeRoot));
            }

            Layouts = IdentityCollection <LayoutFile> .Create(Directory.EnumerateFiles(ThemeRoot).Select(f => new LayoutFile(f)));
        }
Esempio n. 2
0
        public static IdentityCollection <T> Create(IEnumerable <T> collection)
        {
            var namedCollection = new IdentityCollection <T>();

            foreach (var layout in collection)
            {
                namedCollection.Add(layout);
            }

            return(namedCollection);
        }