private async IAsyncEnumerable <IPluginInfo> LoadPluginFiles(ILocation[] locations, List <string> resFileIds) { foreach (var loc in locations) { var pluginsLoc = loc.Combine(Location.Library.PluginsFolderName); if (m_FileLoader.Exists(pluginsLoc)) { await foreach (var pluginLoc in m_FileLoader.EnumSubFolders(pluginsLoc)) { yield return(new PluginInfo(pluginLoc.Segments.Last(), m_FileLoader.LoadFolder(pluginLoc, m_Filter))); } } } if (m_Config.Plugins?.Any() == true) { foreach (var pluginName in m_Config.Plugins) { yield return(new PluginInfo(pluginName, ProcessLibraryItems( m_LibraryLoader.LoadPluginFiles(pluginName, null), resFileIds, true))); } } }
private bool ContainsLibraryItem(string itemType, string itemName) { return(m_FileLoader.Exists(m_Location.Combine(new Location("", "", new string[] { itemType, itemName })))); }