事件
事件
主要事件类型
nc.dispatcher.onMessageReceived += message =>
{
Console.WriteLine("received a new message: ", message);
}事件处理程序的连接与解除
Last updated
nc.dispatcher.onMessageReceived += message =>
{
Console.WriteLine("received a new message: ", message);
}Last updated
// 消息接收
nc.dispatcher.onMessageReceived += e =>
{
Console.WriteLine("onMessageReceived: ", e);
};
// 消息删除
nc.dispatcher.onMessageDeleted += e =>
{
Console.WriteLine("onMessageDeleted: ", e);
};
// 错误消息
nc.dispatcher.onErrorReceived += e =>
{
Console.WriteLine("[CloudChatSample] onErrorReceived: ", e);
};
// 连接成功
nc.dispatcher.onConnected += e =>
{
Console.WriteLine("[CloudChatSample] Connected to server with id: {0} ", e);
};
// 连接结束
nc.dispatcher.onDisconnected += e =>
{
Console.WriteLine("Disconnected");
};
// 开始输入时
nc.dispatcher.onStartTyping += e =>
{
Console.WriteLine("onStartTyping: ", e);
};
// 结束输入时
nc.dispatcher.onStopTyping += e =>
{
Console.WriteLine("onStopTyping: ", e);
};
// 用户在频道中订阅时
nc.dispatcher.onMemberAdded += e =>
{
Console.WriteLine("onMemberAdded: ", e);
};
// 用户在频道中取消订阅时
nc.dispatcher.onMemberLeft += e =>
{
Console.WriteLine("[CloudChatSample] onMemberLeft: ", e);
};
// 用户在频道中被禁言时
nc.dispatcher.onMemberBanned += e =>
{
Console.WriteLine("[CloudChatSample] onMemberBanned: ", e);
};
// 用户在频道中退出时
nc.dispatcher.onMemberDeleted += e =>
{
Console.WriteLine("[CloudChatSample] onMemberDeleted: ", e);
};