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))); }
public static IdentityCollection <T> Create(IEnumerable <T> collection) { var namedCollection = new IdentityCollection <T>(); foreach (var layout in collection) { namedCollection.Add(layout); } return(namedCollection); }