public static MSG_READER_EVENT_NOTIFICATION FromString(string str) { XmlDocument xmlDocument = new XmlDocument(); xmlDocument.LoadXml(str); XmlNode documentElement = (XmlNode)xmlDocument.DocumentElement; XmlNamespaceManager nsmgr = new XmlNamespaceManager(documentElement.OwnerDocument.NameTable); nsmgr.AddNamespace("", "http://www.llrp.org/ltk/schema/core/encoding/xml/1.0"); nsmgr.AddNamespace("llrp", "http://www.llrp.org/ltk/schema/core/encoding/xml/1.0"); MSG_READER_EVENT_NOTIFICATION eventNotification = new MSG_READER_EVENT_NOTIFICATION(); try { eventNotification.MSG_ID = Convert.ToUInt32(XmlUtil.GetNodeAttrValue(documentElement, "MessageID")); } catch { } try { XmlNodeList xmlNodes = XmlUtil.GetXmlNodes(documentElement, "ReaderEventNotificationData", nsmgr); if (xmlNodes != null) { if (xmlNodes.Count != 0) { eventNotification.ReaderEventNotificationData = PARAM_ReaderEventNotificationData.FromXmlNode(xmlNodes[0]); } } } catch { } return(eventNotification); }
public static MSG_READER_EVENT_NOTIFICATION FromBitArray( ref BitArray bit_array, ref int cursor, int length) { if (cursor > length) { return((MSG_READER_EVENT_NOTIFICATION)null); } ArrayList arrayList = new ArrayList(); MSG_READER_EVENT_NOTIFICATION eventNotification = new MSG_READER_EVENT_NOTIFICATION(); cursor += 6; if ((int)(ulong)Util.CalculateVal(ref bit_array, ref cursor, 10) != (int)eventNotification.msgType) { cursor -= 16; return((MSG_READER_EVENT_NOTIFICATION)null); } eventNotification.msgLen = (uint)(ulong)Util.CalculateVal(ref bit_array, ref cursor, 32); eventNotification.msgID = (uint)(ulong)Util.CalculateVal(ref bit_array, ref cursor, 32); eventNotification.ReaderEventNotificationData = PARAM_ReaderEventNotificationData.FromBitArray(ref bit_array, ref cursor, length); return(eventNotification); }