-
Notifications
You must be signed in to change notification settings - Fork 4
Creating a Shell Plugin
Techcraft7 edited this page Jan 12, 2021
·
2 revisions
- Create a Class Library Project with .NET FRAMEWORK 4.7.2 (or higher)
- Create a class that is a child of
7Sharp.Plugins.ShellPlugin - Implement ALL methods of the abstract class! (A plugin cannot be abstract or it will throw an error)
- Create command classes that are children of
7Sharp.Plugins.ShellCommand - Implement ALL methods
- Your code should look like this:
using _7Sharp.Plugins;
namespace ShellPluginTesting
{
public class CoolShellPlugin : ShellPlugin
{
protected override List<ShellCommand> GetCommandsInternal()
{
List<ShellCommand> cmds = new List<ShellCommand>
{
new CoolCommand()
};
return cmds;
}
}
public class CoolCommand : ShellCommand
{
public CoolCommand() : base("cool_command", "do something cool!")
{
}
public override void Run(string[] args)
{
Console.WriteLine("Something cool!");
}
}
}- Compile
- Add the compiled DLL to the
pluginsfolder created by 7Sharp - Run 7Sharp and fix any errors
- No more errors? Type
helpto see your shiny new commands!
