public class SimpleEventHandler
{
[DeclareEventHandler("onMainStart")]
public void MyEventHandlerFunction()
{
new Decider().Decide(EnumDecisionType.eOkDecision, "MyEventHandlerFunction was called!","SimpleEventHandler", EnumDecisionReturn.eOK, EnumDecisionReturn.eOK);
return;
}
}
public class SimpleEventHandler
{
[DeclareEventHandler("onActionStart.String.*")]
public long MyEventHandlerFunction2(IEventParameter iEventParameter)
{
try
{
EventParameterString oEventParameterString= new EventParameterString(iEventParameter);
String strActionName= oEventParameterString.String;
new Decider().Decide(EnumDecisionType.eOkDecision, "Action " + strActionName + " was started!","MyEventHandler", EnumDecisionReturn.eOK, EnumDecisionReturn.eOK);
}
catch (System.InvalidCastException exc)
{
String strExc= exc.Message;
new Decider().Decide(EnumDecisionType.eOkDecision, "Parameter error: " + strExc, "MyEventHandler", EnumDecisionReturn.eOK, EnumDecisionReturn.eOK);
}
return 0;
}
}
Public Class SimpleEventHandler
<DeclareEventHandler("onMainStart")> _
Public Sub MyEventHandlerFunction()
Dim dec As Decider = New Decider
dec.Decide(EnumDecisionType.eOkDecision, "MyEventHandlerFunction was called!", "SimpleEventHandler", EnumDecisionReturn.eOK, EnumDecisionReturn.eOK)
End Sub 'MyEventHandlerFunction
End Class 'SimpleEventHandler
Public Class SimpleEventHandler
<DeclareEventHandler("onActionStart.String.*")> _
Public Function MyEventHandlerFunction2(iEventParameter As IEventParameter) As Long
Dim dec As Decider = New Decider
Try
Dim oEventParameterString As New EventParameterString(iEventParameter)
Dim strActionName As [String] = oEventParameterString.String
dec.Decide(EnumDecisionType.eOkDecision, "Action " + strActionName + " was started!", "MyEventHandler", EnumDecisionReturn.eOK, EnumDecisionReturn.eOK)
Catch exc As System.InvalidCastException
Dim strExc As [String] = exc.Message
dec.Decide(EnumDecisionType.eOkDecision, "Parameter error: " + strExc, "MyEventHandler", EnumDecisionReturn.eOK, EnumDecisionReturn.eOK)
End Try
Return 0
End Function 'MyEventHandlerFunction2
End Class 'SimpleEventHandler