Golem.Core.RecipeCataloger.CatalogueRecipes C# (CSharp) Method

CatalogueRecipes() public method

public CatalogueRecipes ( ) : IList
return IList
        public IList<Recipe> CatalogueRecipes()
        {
            var fileSearch = new RecipeFileSearch(_searchPaths);
            fileSearch.BuildFileList();

            PreLoadAssembliesToPreventAssemblyNotFoundError(
                fileSearch.FoundAssemblyFiles.ToArray()
                );

            ExtractRecipesFromPreLoadedAssemblies();
            return Recipes.ToArray();
        }

Usage Example

        public void Cataloger_Uses_Search_Locations()
        {
            var config = new Configuration();
            var cataloger = new RecipeCataloger(Environment.CurrentDirectory);
            cataloger.CatalogueRecipes();
            config.SearchPaths.AddRange(cataloger.LoadedAssembliesContainingRecipes.Select(la => la.File.FullName));
            Assert.Greater(cataloger.AssembliesExamined.Count, 1);

            var cataloger2 = new RecipeCataloger(config.SearchPaths.ToArray());
            cataloger2.CatalogueRecipes();
            Assert.AreEqual(1, cataloger2.AssembliesExamined.Count);
        }
All Usage Examples Of Golem.Core.RecipeCataloger::CatalogueRecipes