예제 #1
0
 private void __OutsideMessageRecived(ClientDevice sender, BaseMessage msg)
 {
     if (null != this.MessageRecived)
     {
         this.MessageRecived(sender, msg);
     }
 }
예제 #2
0
 private void __refereshGroupMembersInfo()
 {
     if (_Joined)
     {
         List <CSCommunicateClass.ClientInfo> _newBaseDeviceInfoList = null;
         GroupCommunicateLayer gclprocessor = _corelogicProcessor.GroupCommunicateProcessor;
         try
         {
             gclprocessor.GetGroupMembers(this, out _newBaseDeviceInfoList);
         }
         catch (System.Exception ex)
         {
             _members = null;
             throw new GetOnlineGroupClientExcetion(ex.ToString());
         }
         List <ClientDevice> newMembersList = new List <ClientDevice>();
         foreach (CSCommunicateClass.ClientInfo item in _newBaseDeviceInfoList)
         {
             ClientDevice cd = new ClientDevice();
             ClientDevice.Parse(item, cd);
             newMembersList.Add(cd);
         }
         _members = newMembersList;
     }
     else
     {
         throw new GetOnlineGroupClientExcetion("未加入该群组");
     }
 }
예제 #3
0
 /// <summary>
 /// 创建一个请求通讯包
 /// </summary>
 /// <param name="communicateName">请求的名称</param>
 /// <param name="communicateType">请求执行的网络类型</param>
 /// <param name="reqtParamPkg">携带的参数属性包</param>
 /// <param name="targetDevice">目的设备</param>
 /// <param name="waitResponse">是否等待应答</param>
 /// <param name="callback">在异步情形下,收到应答后的通知事件</param>
 /// <returns></returns>
 public RequestCommunicatePackage CreateRequestCommunicatePackage(string communicationName,
                                                                  CommunicatType communicateType,
                                                                  ParamPackage reqtParamPkg,
                                                                  ClientDevice targetDevice,
                                                                  bool waitResponse,
                                                                  AsynReponseHandler callback)
 {
     return(base.CoCreateRequestCommunicatePackage(communicationName,
                                                   communicateType,
                                                   reqtParamPkg,
                                                   targetDevice,
                                                   waitResponse,
                                                   callback));
 }
예제 #4
0
 /// <summary>
 /// 监听一种设备消息
 /// </summary>
 /// <param name="messenger">目标设备</param>
 /// <param name="typMsg">消息定义</param>
 public void Listen(ClientDevice messenger, BaseMessageType typMsg)
 {
     base.CoListen(messenger, typMsg);
 }
예제 #5
0
 internal static void Parse(CSCommunicateClass.ClientInfo clientInfo, ClientDevice cdInst)
 {
     cdInst.Token  = clientInfo.Token;
     cdInst.Detail = clientInfo.Detail;
 }