Example #1
0
        public async Task AddPlugin(List <ZipArchiveEntry> list)
        {
            var pluginPackageFileArchive = list.FirstOrDefault(x => x.Name == "plugin.json");

            if (pluginPackageFileArchive == null)
            {
                throw new InvalidOperationException("plugin packaged zip needs plugin.json at the top level.");
            }
            var pluginPackageFile = await new StreamReader(pluginPackageFileArchive.Open()).ReadToEndAsync();
            await sharedPlugins.AddPlugin(pluginPackageFile, list.ToList());
        }