Exemplo n.º 1
0
        private LoadedPlugin LoadPlugin(string path)
        {
            if (IsZipPlugin(path))
            {
                return(LoadPluginFromZip(path));
            }

            var plugin = File.Exists(path)
                ? LoadPluginFromFile(path)
                : LoadPluginFromFolder(path);

            var manifest = new PluginManifest
            {
                AssemblyQualifiedTypeName = plugin.GetType().AssemblyQualifiedName,
                PluginFolderName          = File.Exists(path)
                    ? new FileInfo(path).Directory?.Name
                    : new DirectoryInfo(path).Name
            };

            return(new LoadedPlugin(plugin, manifest, path));
        }
Exemplo n.º 2
0
 public LoadedPlugin(IFieldDataPlugin plugin, PluginManifest manifest, string path)
 {
     Plugin   = plugin;
     Manifest = manifest;
     Path     = path;
 }
 public LoadedPlugin(IFieldDataPlugin plugin, PluginManifest manifest)
 {
     Plugin   = plugin;
     Manifest = manifest;
 }