using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WeChatCore.Entity;
namespace WeChatCore.Common
{
public static class CommonMethodCallBackHandlers
{
///
/// 下载二维码完成
///
public static event Action DownLoadQRCodeCompleted;
///
/// 下载二维码完成
///
public static void OnDownLoadQRCodeCompleted()
{
if (DownLoadQRCodeCompleted != null)
DownLoadQRCodeCompleted.Invoke();
else
throw new Exception("未实现方法CommonMethodCallBackHandlers.DownLoadQRCodeCompleted");
}
public static event Action LoginScranQRCodeCompleted;
///
/// s扫描二维码等待登录
///
///
public static void OnLoginScranQRCodeCompleted(string Path)
{
if (LoginScranQRCodeCompleted != null)
LoginScranQRCodeCompleted.Invoke(Path);
else
throw new Exception("未实现方法CommonMethodCallBackHandlers.LoginScranQRCodeCompleted");
}
///
/// 登录完成
///
public static event Action LoginCompleted;
///
/// 登录成功
///
public static void OnLoginCompleted(bool e = false)
{
if (LoginCompleted != null)
LoginCompleted.Invoke(e);
else
throw new Exception("未实现方法CommonMethodCallBackHandlers.LoginCompleted");
}
public static event Action ReceivedMsgAnalyseMsgCompleted;
///
/// 接受并分析消息
///
/// 重新封装组合的消息列表
public static void OnReceivedMsgAnalyseMsgCompleted(MsgEntity Me)
{
if (ReceivedMsgAnalyseMsgCompleted != null)
ReceivedMsgAnalyseMsgCompleted.Invoke(Me);
else
throw new Exception("未实现方法CommonMethodCallBackHandlers.ReceivedMsgAnalyseMsgCompleted");
}
///
/// 发送消息完成
///
public static event Action SendMsgCompleted;
///
/// 发送消息完成
///
///
public static void OnSendMsgCompleted(bool e)
{
if (SendMsgCompleted != null)
SendMsgCompleted.Invoke(e);
//else
// throw new Exception("未实现方法CommonMethodCallBackHandlers.SendMsgCompleted");
}
}
}