private void LoadImport(ImportBlock importBlock) { // switch on extension switch (System.IO.Path.GetExtension(importBlock.Path).ToUpperInvariant()) { case ".JS": jsModule.Execute(importBlock.LoadString()); break; case ".SUNA": this.AddModule(new SourceModule(importBlock.LoadString())); break; default: throw new CompileException(Error.InvalidImportExtension); } }
/// <summary> /// looking for the biggest (int)PersonType value /// </summary> /// <param name="categories"></param> /// <returns></returns> internal static PersonType GetPersonTypeByCategories(IList <string> categories) { var biggest = PersonType.Person; if (categories != null) { for (var i = categories.Count - 1; i >= 0; i--) { var cat = categories[i]; PersonType type; if (Enum.TryParse(ImportBlock.GetShortTitle(cat), out type) && type > biggest) { biggest = type; } } } return(biggest); }