示例#1
0
    public async Task <Addon?> LoadDefaultCatalogAddons()
    {
        var allAddons = DefaultAddons.AllDefaultAddons();

        if (allAddons == null)
        {
            return(null);
        }

        foreach (var addon in allAddons)
        {
            if (addon.Manifest?.ResourcesString is not null && addon.Manifest.ResourcesString.Contains(AddonConstants.ResourcesCatalog))
            {
                return(addon);
            }

            if (addon.Manifest?.Resources is not null && addon.Manifest.Resources.Select(r => r.Name).Contains(AddonConstants.ResourcesCatalog))
            {
                return(addon);
            }
        }

        return(await Task.FromResult(new Addon()));
    }
示例#2
0
 public async Task <IEnumerable <Addon>?> LoadDefaultAddons()
 {
     return(await Task.FromResult(DefaultAddons.AllDefaultAddons()));
 }