You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: GUIDE.md
+23Lines changed: 23 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -25,6 +25,8 @@ public override string name {
25
25
}
26
26
```
27
27
28
+
Don't worry about the schemas error. We'll deal with that later.'
29
+
28
30
## Parameters in Plugs
29
31
30
32
Parameters are passed to functions in plugs with *schemas*. A schema is a class with
@@ -59,6 +61,27 @@ public class AddSchema{
59
61
}
60
62
```
61
63
64
+
## Defining the Schemas
65
+
66
+
Once you have functions and the schemas they need, you must declare a Dictionary<string, Type> property to tell PlugPlex about the schemas.
67
+
Each entry in the dictionary sould have a `string` key representing the name of a function, and a `Type` value representing the `typeof` the schema the
68
+
function takes as a parameter. For example, a schema dictionary for the `Print` and `Add` functions above would look like this:
69
+
70
+
```C#
71
+
publicDictionary<string, Type>schemas {
72
+
get {
73
+
Dictionary<string, Type>_schemas
74
+
75
+
_schemas.Add("Print", typeof(PrintSchema));
76
+
_schemas.Add("Add", typeof(AddSchema));
77
+
78
+
return_schemas;
79
+
}
80
+
}
81
+
```
82
+
83
+
You must declare the schemas for every function you intend to call from javascript.
84
+
62
85
## Using the Plug
63
86
64
87
To use your plug, build the project and copy the DLL into the PlugPlex `Plugs` folder.
0 commit comments