Running the following plugin creates an AmwFileWritten event handler. Each time Amos Graphics writes an AMW file, the event handler displays the file's name in a message box.
Imports Microsoft.VisualBasic
Imports Amos
<System.ComponentModel.Composition.Export(GetType(IPlugin))>
Public Class CustomCode
Implements IPlugin
Public Function Mainsub() As Integer Implements IPlugin.Mainsub
AddHandler pd.AmwFileWritten, AddressOf AmwFileWritten
MsgBox("AmwFileWritten Event Example is now installed.")
End Function
Private Sub AmwFileWritten(ByVal FileName As String, ByVal IsTemplate As Boolean)
If IsTemplate Then
MsgBox(FileName & " has just been written as a template file.")
Else
MsgBox(FileName & " has just been written.")
End If
End Sub
Public Function Name() As String Implements IPlugin.Name
End Function
Public Function Description() As String Implements IPlugin.Description
End Function
End Class