BasicNoUIObjWriteMacro Event |
Occurs when a macro/module needs to be written to storage.
Namespace: WinWrap.Basic.ServerAssembly: WinWrap.Basic.Server (in WinWrap.Basic.Server.dll)
Syntaxpublic event EventHandler<WriteMacroEventArgs> WriteMacro
Public Event WriteMacro As EventHandler(Of WriteMacroEventArgs)
public:
virtual event EventHandler<WriteMacroEventArgs^>^ WriteMacro {
void add (EventHandler<WriteMacroEventArgs^>^ value);
void remove (EventHandler<WriteMacroEventArgs^>^ value);
}
Value
EventHandlerWriteMacroEventArgsImplements
IBasicNoUIWriteMacro
Remarks
The event handler receives an argument of type
WriteMacroEventArgs.
Property
|
Description
|
---|
FileName
|
The file name.
FileName, is the name of the macro/module
that needs to be written.
Its first character will always be '*'.
|
Code
|
The code.
The macro/module's text.
|
Cancel
| -
False - The macro/module's text in Code has been written successfully
by this event.
-
True - WinWrap Basic will indicate that the macro/module could not be
written and terminate the operation that is writing a macro/module.
|
Implement this event if you are going
to store macros/modules somewhere besides the file system.
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
Write saved macros to an application collection of macros:
private void basicIdeCtl1_WriteMacro(object sender, WriteMacroEventArgs e)
{
MyMacros(e.FileName).Code = e.Code;
e.Cancel = false;
}
Private Sub BasicIdeCtl1_WriteMacro(ByVal sender As Object, ByVal e As WriteMacroEventArgs) Handles BasicIdeCtl.WriteMacro
MyMacros(e.FileName).Code = e.Code
e.Cancel = False
End Sub
private: System::Void basicIdeCtl1_WriteMacro(System::Object ^ sender, WriteMacroEventArgs ^ e)
{
MyMacros(e->FileName)->Code = e->Code;
e->Cancel = false;
}
See Also