BasicNoUIObjCreateHandlers Method |
Create a collection of
Handler objects.
Namespace: WinWrap.Basic.ServerAssembly: WinWrap.Basic.Server (in WinWrap.Basic.Server.dll)
Syntaxpublic Handlers? CreateHandlers(
string prefix,
Object eventObj
)
Public Function CreateHandlers (
prefix As String,
eventObj As Object
) As Handlers
public:
virtual Handlers^ CreateHandlers(
String^ prefix,
Object^ eventObj
) sealed
Parameters
- prefix String
-
All the handlers have this prefix prepended to the names of the methods in
eventObj's type.
- eventObj Object
-
Use this type as the source of the method descriptions used for the handlers.
(Subs or functions with '_' in the name are ignored.)
Return Value
Handlers
A
Handlers collection.
Implements
IBasicNoUICreateHandlers(String, Object)
Remarks2025-01-24: This method does not do anything at this time.
The IDE shows the
Handlers in the object/proc drop down lists.
Use "modulepath|prefix" to create module specific Handlers.
If modulepath is a null string,
FileName is used.
(The string "|..." is the same as prefixing the string with FileName.)
An individual Handler in the collection can be accessed using
the normal collection index operator.
If prefix begins with "{type}", where type is the name of the language
extension type, create handlers for the type's source interface.
For example:
If
prefix has multiple lines (separated by carriage-return line-feed),
create handlers for each line's prototype.
For example:
Thing_
Changed
Changing(Cancel As Boolean)
This method must be called BEFORE the target code is loaded.
Macro/Module Paths
Macro/module paths are typically file paths.
However, it is sometimes useful to work with macros/modules that are not
stored as files.
A macro/module path is of the form:
Part
|
Description
|
---|
'*'
|
Paths that being with '*' are non-file system macro/modules.
The application provides the methods for reading and writing these files.
Paths that begin and end with '*' are hidden from the IDE.
User's can't step into or otherwise inspect the contents.
|
'**'
|
Paths that begin with '**' are non-file system modules.
The application provides the methods for reading and writing these files.
Running an event-driven module loads it using LoadModule.
|
path
|
This is the identity of the macro/module.
|
Example
Create a collection of handlers:
Private Handlers handlers;
private void Form1_Load(object sender, System.EventArgs e)
{
handlers = BasicIdeCtl1.CreateHandlers("App_", appEvents);
}
private void Form1_Closed(object sender, System.Windows.Forms.FormClosedEventArgs e)
{
if (handlers != null)
handlers.Dispose();
}
Private Handlers As Handlers
Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
Handlers = BasicIdeCtl1.CreateHandlers("App_", AppEvents)
End Sub
Private Sub Form1_FormClosed(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosedEventArgs) Handles Me.FormClosed
If Handlers IsNot Nothing Then Handlers.Dispose()
End Sub
private Handlers ^ handlers;
private: System::Void Form1_Load(System::Object ^ sender, System::EventArgs ^ e)
{
handlers = BasicIdeCtl1->CreateHandlers(L"App_", appEvents);
}
private: System::Void Form1_Closed(System::Object ^ sender, System::Windows::Forms::FormClosedEventArgs ^ e)
{
if (handlers != NULL)
handlers->Dispose();
}
See Also