Пример #1
0
 public NexoMessageHeader(MessageHeaderType mh, NexoProtocolVersion server = null)
 {
     Response        = new NexoResponseType();
     Type            = MessageHeaderToType(mh);
     Class           = MessageHeaderToClass(mh);
     Category        = MessageHeaderToCategory(mh);
     POIID           = new NexoPOIID(mh.POIID);
     SaleID          = new NexoSaleID(mh.SaleID);
     DeviceID        = new NexoDeviceID(mh.DeviceID);
     ServiceID       = new NexoServiceID(mh.ServiceID);
     ProtocolVersion = new NexoProtocolVersion()
     {
         Value = (MessageCategoryEnumeration.Login == Category ? mh.ProtocolVersion : null)
     };
     ServerVersion   = server;
     Response.Result = ResultEnumeration.Success;
 }
Пример #2
0
        public NexoPartner(TcpClient tcp, MessageHeaderType mh)
        {
            SaleID   = new NexoSaleID(CMisc.AsString(mh.SaleID));
            POIID    = new NexoPOIID(CMisc.AsString(mh.POIID));
            EndPoint = new NexoEndPoint(tcp);

            _sessions = new NexoListOfSessions("SESSIONS");
            _messages = new NexoDictionaryOfMessages();

#if NET35
            Sessions = _sessions;
            Messages = _messages;
#else
            Sessions = new ReadOnlyCollection <NexoSession>(_sessions);
            Messages = new ReadOnlyDictionary <string, NexoMessage>(_messages);
#endif

            Timestamp   = DateTime.Now;
            Key         = GetKey(this);
            Description = GetDescription();
        }