Exemplo n.º 1
0
        public override object ReadObject(XmlReader reader)
        {
            SimpleEventRequest SimpleEventRequestField = null;

            if (IsParentStartElement(reader, false, true))
            {
                SimpleEventRequestField         = new SimpleEventRequest();
                SimpleEventRequestField.AnyAttr = ReadAnyAttribute(reader);
                reader.Read();
                if (IsChildStartElement(reader, "Param", true, true))
                {
                    reader.Read();
                    string[] Param_List = reader.ReadString().Split();
                    if ((this._CompressByteArrays ||
                         ((Param_List.Length == 1) &&
                          (Param_List[0].Length > 2))))
                    {
                        SimpleEventRequestField.Param = Convert.FromBase64String(Param_List[0]);
                    }
                    else
                    {
                        SimpleEventRequestField.Param = new byte[Param_List.Length];
                        for (int i = 0; (i < Param_List.Length); i = (i + 1))
                        {
                            SimpleEventRequestField.Param[i] = XmlConvert.ToByte(Param_List[i]);
                        }
                    }
                    reader.ReadEndElement();
                }
                SimpleEventRequestField.Any = ReadAnyElement(reader, false);
                reader.ReadEndElement();
            }
            return(SimpleEventRequestField);
        }
Exemplo n.º 2
0
        public override object ReadObject(XmlReader reader)
        {
            isValid isValidField = null;

            if (IsParentStartElement(reader, false, true))
            {
                isValidField = new isValid();
                reader.Read();
                if (IsChildStartElement(reader, "mac", true, false))
                {
                    reader.Read();
                    isValidField.mac = reader.ReadString();
                    reader.ReadEndElement();
                }
                if (IsChildStartElement(reader, "pin", true, false))
                {
                    reader.Read();
                    string[] pin_List = reader.ReadString().Split();
                    if ((this._CompressByteArrays ||
                         ((pin_List.Length == 1) &&
                          (pin_List[0].Length > 2))))
                    {
                        isValidField.pin = Convert.FromBase64String(pin_List[0]);
                    }
                    else
                    {
                        isValidField.pin = new byte[pin_List.Length];
                        for (int i = 0; (i < pin_List.Length); i = (i + 1))
                        {
                            isValidField.pin[i] = XmlConvert.ToByte(pin_List[i]);
                        }
                    }
                    reader.ReadEndElement();
                }
                reader.ReadEndElement();
            }
            return(isValidField);
        }