-
Notifications
You must be signed in to change notification settings - Fork 0
API usage
SETUP
First download the dll, or compile the project to get the API dll. Next start a new class library project. Next add a reference to System.ComponentModule.Composition and the API Add a using statement for System.ComponentModule.Composition and a using statement for returnzork.BackupV3_API
Coding
- change the public class Class1 to class Class1 : BackupV3API
- Above the new interface, add [Export(typeof(BackupV3API))]
- in the interface method, add 5 methods. Method 1: public string Author() Method 2: public string Version() Method 3: public string Name() Method 4: public void Work(string[] imports) Method 5: public void Interface()
Method 1 returns the author name, Method 2 returns the version number (with a string, not an int) Method 3 returns the plugin Name (should be a brief description) Method 4 is the work that this plugin does Method 5 is an interface for your plugin, for a settings menu etc.
Now you should have:
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.ComponentModel.Composition; using returnzork.BackupV3_API;
namespace Plugin_2 { [Export(typeof(BackupV3API))] class Class1 : BackupV3API { public string Author() { return "author"; }
public string Version()
{
return "version number";
}
public string Name()
{
return "plugin name";
}
public void Work(string[] imports)
{
}
public void Interface()
{
}
}
}