Exemple #1
0
        public bool Send(MsgEntity msg)
        {
            if (OnSending != null)
            {
                MsgCancleEventArgs args = new MsgCancleEventArgs(msg);
                OnSending(args);
                if (args.IsCancle)
                {
                    return(false);
                }
            }

            if (string.IsNullOrEmpty(msg.SenderID))
            {
                msg.SenderID = Session.Instance.CurrenterUser.ID;
            }
            msg.SendTime = Session.Instance.ServerDateTime;


            #region 真正发送消息的代码

            #endregion

            if (OnSended != null)
            {
                OnSended(new MsgEventArgs(msg));
            }
            return(true);
        }
Exemple #2
0
        public bool Send(string Reciverd, string msg, MsgSendType type = MsgSendType.基本消息)
        {
            MsgEntity msgEntiy = new MsgEntity()
            {
                Reciver = Reciverd, MsgContent = msg, MsgSendType = type
            };

            return(Send(msgEntiy));
        }
Exemple #3
0
 public MsgCancleEventArgs(MsgEntity msg)
 {
     Msg = msg;
 }
Exemple #4
0
 public MsgEventArgs(MsgEntity msg)
 {
     Msg = msg;
 }