ScriptStack 1.0.0
A .NET scripting language
|
A Model is an abstract representation of an object your Host works with. It implements Routine's and can be registered by a Host to exted the Host's functionality. Mehr ...
Propertys | |
ReadOnlyCollection< Routine > | Routines [get] |
Returns all Routine's a Model implements. | |
Weitere Geerbte Elemente | |
Öffentliche Methoden geerbt von ScriptStack.Runtime.Host | |
object | Invoke (string routine, List< object > parameters) |
Called when a Routine is invoked. | |
A Model is an abstract representation of an object your Host works with. It implements Routine's and can be registered by a Host to exted the Host's functionality.
A Model must implement the Invoke() method. As you can see, it is just an empty declaration to hook in.
Every time a Routine is requested from within a script, this method is invoked either on the Host or on the Model which provides the requested Routine.
A Model must also implement a Prototypes property with a public 'getter' which returns a ReadOnlyCollection of all Routine's.
The logic (the function body) of the Routine's is implemented inside the Invoke method.
A Model class with 2 registered Routines ("toUpper", "toLower") would look like the following example.
|
get |
Returns all Routine's a Model implements.