update nugets & cleanup
This commit is contained in:
@@ -1,15 +1,14 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<TargetFrameworks>net6.0;net8.0</TargetFrameworks>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
|
||||
<IncrementVersionOnBuild>1.yyyy.Mdd.Hmm</IncrementVersionOnBuild>
|
||||
<Version>1.2023.1114.1439</Version>
|
||||
<Version>2.0.0</Version>
|
||||
</PropertyGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
@@ -10,6 +10,11 @@ namespace Pilz.Plugins
|
||||
public class PluginManager<TPluginInterface, TPluginRuntimeInfo> where TPluginInterface : class where TPluginRuntimeInfo : PluginRuntimeInfo<TPluginInterface>
|
||||
{
|
||||
public IEnumerable<TPluginRuntimeInfo> LoadPlugins(string[] paths)
|
||||
{
|
||||
return LoadPlugins(paths, null);
|
||||
}
|
||||
|
||||
public IEnumerable<TPluginRuntimeInfo> LoadPlugins(string[] paths, params object?[]? parameters)
|
||||
{
|
||||
var states = new List<TPluginRuntimeInfo>();
|
||||
|
||||
@@ -20,6 +25,11 @@ namespace Pilz.Plugins
|
||||
}
|
||||
|
||||
public TPluginRuntimeInfo LoadPlugin(string path)
|
||||
{
|
||||
return LoadPlugin(path, null);
|
||||
}
|
||||
|
||||
public TPluginRuntimeInfo LoadPlugin(string path, params object?[]? parameters)
|
||||
{
|
||||
var info = Activator.CreateInstance<TPluginRuntimeInfo>();
|
||||
var irmplugin = typeof(TPluginInterface);
|
||||
@@ -48,7 +58,7 @@ namespace Pilz.Plugins
|
||||
{
|
||||
try
|
||||
{
|
||||
if (Activator.CreateInstance(type) is TPluginInterface plugin)
|
||||
if (Activator.CreateInstance(type, parameters) is TPluginInterface plugin)
|
||||
{
|
||||
info.Plugin = plugin;
|
||||
info.Status = PluginStatus.Success;
|
||||
|
||||
Reference in New Issue
Block a user