Beispiel #1
0
        public new static MSG_READER_EVENT_NOTIFICATION FromString(string str)
        {
            string val;

            XmlDocument xdoc = new XmlDocument();
            xdoc.LoadXml(str);
            XmlNode node = (XmlNode)xdoc.DocumentElement;

            MSG_READER_EVENT_NOTIFICATION msg = new MSG_READER_EVENT_NOTIFICATION();
            try { msg.MSG_ID = Convert.ToUInt32(XmlUtil.GetNodeAttrValue(node, "MessageID")); }
            catch { }


            try
            {

                XmlNodeList xnl = XmlUtil.GetXmlNodes(node, "ReaderEventNotificationData");
                if (null != xnl)
                {
                    if (xnl.Count != 0)
                        msg.ReaderEventNotificationData = PARAM_ReaderEventNotificationData.FromXmlNode(xnl[0]);
                }

            }
            catch { }

            return msg;
        }
Beispiel #2
0
        public new static MSG_READER_EVENT_NOTIFICATION FromBitArray(ref BitArray bit_array, ref int cursor, int length)
        {
            if (cursor > length) return null;

            int field_len = 0;
            object obj_val;
            ArrayList param_list = new ArrayList();

            MSG_READER_EVENT_NOTIFICATION obj = new MSG_READER_EVENT_NOTIFICATION();

            int msg_type = 0;
            cursor += 6;
            msg_type = (int)(UInt64)Util.CalculateVal(ref bit_array, ref cursor, 10);

            if (msg_type != obj.msgType)
            {
                cursor -= 16;
                return null;
            }

            obj.msgLen = (UInt32)(UInt64)Util.CalculateVal(ref bit_array, ref cursor, 32);
            obj.msgID = (UInt32)(UInt64)Util.CalculateVal(ref bit_array, ref cursor, 32);


            obj.ReaderEventNotificationData = PARAM_ReaderEventNotificationData.FromBitArray(ref bit_array, ref cursor, length);

            return obj;
        }
Beispiel #3
0
 private void UpdateReaderEvent(MSG_READER_EVENT_NOTIFICATION msg)
 {
     try
     {
         WriteMessage(msg.ToString());
     }
     catch (Exception e)
     {
         WriteMessage("UpdateReaderEvent " + e.Message);
     }
 }
Beispiel #4
0
 protected void TriggerReaderEventNotification(MSG_READER_EVENT_NOTIFICATION msg)
 {
     try
     {
         if (OnReaderEventNotification != null) OnReaderEventNotification(msg);
         if (OnEncapedReaderEventNotification != null)
         {
             ENCAPED_READER_EVENT_NOTIFICATION ntf = new ENCAPED_READER_EVENT_NOTIFICATION();
             ntf.reader = reader_name;
             ntf.ntf = msg;
         }
     }
     catch { }
 }
Beispiel #5
0
 public void reader_OnReaderEventNotification(MSG_READER_EVENT_NOTIFICATION msg)
 {
     //delegateReaderEventNotification del = UpdateReaderEvent;
     delegateReaderEventNotification del = UpdateReaderEvent;
     del.BeginInvoke(msg, OnAsyncCallBack, null);
 }