Skip to content

Commit 95a1eb3

Browse files
committed
Update README.md
1 parent 56bb444 commit 95a1eb3

File tree

1 file changed

+33
-1
lines changed

1 file changed

+33
-1
lines changed

src/Attributes/README.md

+33-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,35 @@
11
# CPlugin.Net.Attributes
22

3-
A simple library that includes the `PluginAttribute` type to be used by plugins.
3+
A simple library that includes the [PluginAttribute](https://mrdave1999.github.io/CPlugin.Net/api/CPlugin.Net.PluginAttribute.html) type to be used by plugins.
4+
5+
### Example
6+
7+
`IPluginStartup` represents the contract and can reside in its own project called `MyApp.Contracts`.
8+
9+
Each plugin must implement the contract in this way:
10+
```cs
11+
public class Startup : IPluginStartup
12+
{
13+
14+
}
15+
```
16+
17+
And then add this line before the namespace declaration:
18+
```cs
19+
[assembly: Plugin(typeof(Startup))]
20+
```
21+
22+
**Complete example:**
23+
```cs
24+
using Project.MyPlugin1;
25+
using MyApp.Contracts;
26+
using CPlugin.Net;
27+
28+
[assembly: Plugin(typeof(Startup))]
29+
namespace Project.MyPlugin1;
30+
31+
public class Startup : IPluginStartup
32+
{
33+
34+
}
35+
```

0 commit comments

Comments
 (0)