43 lines
701 B
C#
43 lines
701 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading;
|
|
using System.Threading.Tasks;
|
|
|
|
public class CallbackObjectFromJs : CallbackBsae
|
|
{
|
|
public event Action<String> ExecMsg;
|
|
|
|
public CallbackObjectFromJs()
|
|
{
|
|
|
|
}
|
|
/// <summary>
|
|
/// 必须小写
|
|
/// </summary>
|
|
/// <param name="msg"></param>
|
|
public void receivemsg(string msg)
|
|
{
|
|
this.Invoke(msg);
|
|
}
|
|
|
|
private void Invoke(string msg)
|
|
{
|
|
Action<String> ExecMsgT = ExecMsg;
|
|
if (ExecMsgT != null)
|
|
{
|
|
ExecMsgT(msg);
|
|
}
|
|
else
|
|
{
|
|
|
|
}
|
|
}
|
|
~CallbackObjectFromJs()
|
|
{
|
|
|
|
}
|
|
|
|
|
|
} |