public static PARAM_AccessCommand FromXmlNode(XmlNode node) { string val; PARAM_AccessCommand param = new PARAM_AccessCommand(); { param.AirProtocolTagSpec = new UNION_AirProtocolTagSpec(); try { { XmlNodeList xnl = XmlUtil.GetXmlNodes(node, "C1G2TagSpec"); if (xnl.Count != 0) { for (int i = 0; i < xnl.Count; i++) param.AirProtocolTagSpec.Add(PARAM_C1G2TagSpec.FromXmlNode(xnl[i])); } } } catch { } } { param.AccessCommandOpSpec = new UNION_AccessCommandOpSpec(); try { { XmlNodeList xnl = XmlUtil.GetXmlNodes(node, "C1G2Read"); if (xnl.Count != 0) { for (int i = 0; i < xnl.Count; i++) param.AccessCommandOpSpec.Add(PARAM_C1G2Read.FromXmlNode(xnl[i])); } } { XmlNodeList xnl = XmlUtil.GetXmlNodes(node, "C1G2Write"); if (xnl.Count != 0) { for (int i = 0; i < xnl.Count; i++) param.AccessCommandOpSpec.Add(PARAM_C1G2Write.FromXmlNode(xnl[i])); } } { XmlNodeList xnl = XmlUtil.GetXmlNodes(node, "C1G2Kill"); if (xnl.Count != 0) { for (int i = 0; i < xnl.Count; i++) param.AccessCommandOpSpec.Add(PARAM_C1G2Kill.FromXmlNode(xnl[i])); } } { XmlNodeList xnl = XmlUtil.GetXmlNodes(node, "C1G2Lock"); if (xnl.Count != 0) { for (int i = 0; i < xnl.Count; i++) param.AccessCommandOpSpec.Add(PARAM_C1G2Lock.FromXmlNode(xnl[i])); } } { XmlNodeList xnl = XmlUtil.GetXmlNodes(node, "C1G2BlockErase"); if (xnl.Count != 0) { for (int i = 0; i < xnl.Count; i++) param.AccessCommandOpSpec.Add(PARAM_C1G2BlockErase.FromXmlNode(xnl[i])); } } { XmlNodeList xnl = XmlUtil.GetXmlNodes(node, "C1G2BlockWrite"); if (xnl.Count != 0) { for (int i = 0; i < xnl.Count; i++) param.AccessCommandOpSpec.Add(PARAM_C1G2BlockWrite.FromXmlNode(xnl[i])); } } } catch { } } try { ArrayList xnl = XmlUtil.GetXmlNodeCustomChildren(node); if (xnl != null) { if (xnl.Count != 0) { for (int i = 0; i < xnl.Count; i++) { ICustom_Parameter custom = CustomParamDecodeFactory.DecodeXmlNodeToCustomParameter((XmlNode)xnl[i]); if (custom != null) param.AddCustomParameter(custom); } } } } catch { } return param; }
public new static PARAM_AccessCommand FromBitArray(ref BitArray bit_array, ref int cursor, int length) { if (cursor >= length) return null; int field_len = 0; object obj_val; int parameter_len = 0; ArrayList param_list = new ArrayList(); PARAM_AccessCommand param = new PARAM_AccessCommand(); int param_type = 0; if (bit_array[cursor]) param.tvCoding = true; if (param.tvCoding) { cursor++; param_type = (int)(UInt64)Util.CalculateVal(ref bit_array, ref cursor, 7); if (param_type != param.TypeID) { cursor -= 8; return null; } } else { cursor += 6; param_type = (int)(UInt64)Util.CalculateVal(ref bit_array, ref cursor, 10); if (param_type != param.TypeID) { cursor -= 16; return null; } param.length = (UInt16)(int)Util.DetermineFieldLength(ref bit_array, ref cursor); } PARAM_C1G2TagSpec _param_C1G2TagSpec = PARAM_C1G2TagSpec.FromBitArray(ref bit_array, ref cursor, length); if (_param_C1G2TagSpec != null) { param.AirProtocolTagSpec.Add(_param_C1G2TagSpec); while ((_param_C1G2TagSpec = PARAM_C1G2TagSpec.FromBitArray(ref bit_array, ref cursor, length)) != null) param.AirProtocolTagSpec.Add(_param_C1G2TagSpec); } PARAM_C1G2Read _param_C1G2Read = PARAM_C1G2Read.FromBitArray(ref bit_array, ref cursor, length); if (_param_C1G2Read != null) { param.AccessCommandOpSpec.Add(_param_C1G2Read); while ((_param_C1G2Read = PARAM_C1G2Read.FromBitArray(ref bit_array, ref cursor, length)) != null) param.AccessCommandOpSpec.Add(_param_C1G2Read); } PARAM_C1G2Write _param_C1G2Write = PARAM_C1G2Write.FromBitArray(ref bit_array, ref cursor, length); if (_param_C1G2Write != null) { param.AccessCommandOpSpec.Add(_param_C1G2Write); while ((_param_C1G2Write = PARAM_C1G2Write.FromBitArray(ref bit_array, ref cursor, length)) != null) param.AccessCommandOpSpec.Add(_param_C1G2Write); } PARAM_C1G2Kill _param_C1G2Kill = PARAM_C1G2Kill.FromBitArray(ref bit_array, ref cursor, length); if (_param_C1G2Kill != null) { param.AccessCommandOpSpec.Add(_param_C1G2Kill); while ((_param_C1G2Kill = PARAM_C1G2Kill.FromBitArray(ref bit_array, ref cursor, length)) != null) param.AccessCommandOpSpec.Add(_param_C1G2Kill); } PARAM_C1G2Lock _param_C1G2Lock = PARAM_C1G2Lock.FromBitArray(ref bit_array, ref cursor, length); if (_param_C1G2Lock != null) { param.AccessCommandOpSpec.Add(_param_C1G2Lock); while ((_param_C1G2Lock = PARAM_C1G2Lock.FromBitArray(ref bit_array, ref cursor, length)) != null) param.AccessCommandOpSpec.Add(_param_C1G2Lock); } PARAM_C1G2BlockErase _param_C1G2BlockErase = PARAM_C1G2BlockErase.FromBitArray(ref bit_array, ref cursor, length); if (_param_C1G2BlockErase != null) { param.AccessCommandOpSpec.Add(_param_C1G2BlockErase); while ((_param_C1G2BlockErase = PARAM_C1G2BlockErase.FromBitArray(ref bit_array, ref cursor, length)) != null) param.AccessCommandOpSpec.Add(_param_C1G2BlockErase); } PARAM_C1G2BlockWrite _param_C1G2BlockWrite = PARAM_C1G2BlockWrite.FromBitArray(ref bit_array, ref cursor, length); if (_param_C1G2BlockWrite != null) { param.AccessCommandOpSpec.Add(_param_C1G2BlockWrite); while ((_param_C1G2BlockWrite = PARAM_C1G2BlockWrite.FromBitArray(ref bit_array, ref cursor, length)) != null) param.AccessCommandOpSpec.Add(_param_C1G2BlockWrite); } ICustom_Parameter custom = CustomParamDecodeFactory.DecodeCustomParameter(ref bit_array, ref cursor, length); if (custom != null) { param.Custom.Add(custom); while ((custom = CustomParamDecodeFactory.DecodeCustomParameter(ref bit_array, ref cursor, length)) != null) param.Custom.Add(custom); } return param; }