Pluginer 2.0.1
dotnet add package Pluginer --version 2.0.1
NuGet\Install-Package Pluginer -Version 2.0.1
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Pluginer" Version="2.0.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Pluginer --version 2.0.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Pluginer, 2.0.1"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Pluginer as a Cake Addin
#addin nuget:?package=Pluginer&version=2.0.1
// Install Pluginer as a Cake Tool
#tool nuget:?package=Pluginer&version=2.0.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Pluginer
Run dll files as a plugin
Install Nuget
Install-Package Pluginer -Version 2.0.1
How to Work
- Pluginer used to run dll files inside a path.
- Each plugin file (dll) can be placed directly in the plugins path or it can be placed in a seperate folder in the plugins path with the same name as the plugin
- The default plugins path is
Plugins
folder in the application root path - By default, the Pluginer will instance only classes that inherit from
Pluginer.PluginObject
. you can change it by assigning parents parameter in thePluginRunner
constructor. in addition when parents are empty, Pluginer create object for each classes.
Example
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Pluginer;
namespace PluginerDemo
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
var pr = new PluginRunner();
pr.OnLoadClass += Pr_OnLoadClass;
pr.OnLoadPlugin += Pr_OnLoadPlugin;
pr.OnError += Pr_OnError;
var args = new PluginArgs();
args["form"] = this;
pr.Load(args);
}
private void Pr_OnLoadPlugin(PluginRunner runner, PluginEventArgs e)
{
rtb.AppendText($"> The plugin `{e.Plugin.Name}` Loaded.\n");
}
private void Pr_OnLoadClass(PluginRunner runner, PluginEventArgs e)
{
rtb.AppendText($"> The class : `{e.Type}` Loaded from plugin `{e.Plugin.Name}`\n");
}
private void Pr_OnError(PluginRunner runner, PluginEventArgs e)
{
rtb.AppendText($"> Error Plugin `{e.Plugin.Name}`: `{e.Error.Message}`\n");
}
}
}
Sample Plugin
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace ClassLibrary1
{
public class Class1 : Pluginer.PluginObject
{
public Class1(Pluginer.PluginArgs args)
{
MessageBox.Show("Hi");
dynamic form = args["form"];
form.menuStrip1.Items.Add("Menu 1");
form.menuStrip1.Items.Add("Menu 2");
form.menuStrip1.Items.Add("Menu 3");
form.menuStrip1.Items.Add("Menu 4");
form.menuStrip1.Items.Add("Menu 5");
//Notice: don't forgot to change menuStrip1 control Modifiers to public
}
}
}
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 is compatible. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net5.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
2.0.1 | 467 | 1/19/2022 |