Skip to content

Creating a Shell Plugin

Techcraft7 edited this page Jan 12, 2021 · 2 revisions

2.0 is currently in development! Expect bugs!

  1. Create a Class Library Project with .NET FRAMEWORK 4.7.2 (or higher)
  2. Create a class that is a child of 7Sharp.Plugins.ShellPlugin
  3. Implement ALL methods of the abstract class! (A plugin cannot be abstract or it will throw an error)
  4. Create command classes that are children of 7Sharp.Plugins.ShellCommand
  5. Implement ALL methods
  6. 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!");
        }
    }
}
  1. Compile
  2. Add the compiled DLL to the plugins folder created by 7Sharp
  3. Run 7Sharp and fix any errors
  4. No more errors? Type help to see your shiny new commands!

Clone this wiki locally