AYUDA EN LÍNEA
 WINDEVWEBDEV Y WINDEV MOBILE

Ayuda / WLanguage / Funciones WLanguage / Comunicación / Funciones .Net
  • Example: call to a procedure
DotNetDelegate (Example)
Example: call to a procedure
//------------------------------------------------
clDotNet is ClassEventManagement
 
clDotNet:add_m_LogHandler(DotNetDelegate("Proc_Handler", ...
"EventHandler<DllDotNetDelegate.MsgEvent>"))
clDotNet:add_m_LogHandler(DotNetDelegate("Proc_Test", ...
"EventHandler<DllDotNetDelegate.MsgEvent>"))
 
clDotNet:SendAMessage(gsStringSent)
//-------------------------------------------------
 
PROCEDURE Proc_Test(src, args)
 
//Global variable to indicate that the delegate was called
gbDelegateCalled = True
 
sString is string = args:get_Message()
pclMyObj is MsgEvent dynamic = args
 
IF sString = gsStringSent THEN
Info("1) OK: the string passed as parameter via the delegate"  ...
"is identical to the string received")
ELSE
Info("1) The string passed as parameter via the delegate " + ...
"is not identical to the string received. "+ ...
sString + " instead of " + gsStringSent)
END
 
IF pclMyObj:get_Message() = gsStringSent THEN
Info("2) OK: the string passed as parameter via the delegate"  ...
"is identical to the string received")
ELSE
Info("2) The string passed as parameter via the delegate " + ...
"is not identical to the string received. "+ ...
pclMyObj:get_Message() + " instead of " + gsStringSent)
END
Versión mínima requerida
  • Versión 11
Esta página también está disponible para…
Comentarios
Haga clic en [Agregar] para publicar un comentario

Última modificación: 27/05/2022

Señalar un error o enviar una sugerencia | Ayuda local