コード例 #1
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="reader"></param>
        /// <param name="preApproval"></param>
        internal static void Read(XmlReader reader, PreApprovalSummary preApproval)
        {
            if (reader.IsEmptyElement)
            {
                XMLParserUtils.SkipNode(reader);
                return;
            }

            reader.ReadStartElement(SerializerHelper.PreApproval);

            reader.MoveToContent();

            while (!reader.EOF)
            {

                if (XMLParserUtils.IsEndElement(reader, SerializerHelper.PreApproval))
                {
                    XMLParserUtils.SkipNode(reader);
                    break;
                }

                if (reader.NodeType == XmlNodeType.Element)
                {
                    switch (reader.Name)
                    {
                        case SerializerHelper.Code:
                            preApproval.Code = reader.ReadElementContentAsString();
                            break;
                        case SerializerHelper.Date:
                            preApproval.Date = reader.ReadElementContentAsDateTime();
                            break;
                        case SerializerHelper.Reference:
                            preApproval.Reference = reader.ReadElementContentAsString();
                            break;
                        case SerializerHelper.TransactionStatus:
                            preApproval.Status = reader.ReadElementContentAsString();
                            break;
                        case SerializerHelper.LastEventDate:
                            preApproval.LastEventDate = reader.ReadElementContentAsDateTime();
                            break;
                        case SerializerHelper.Name:
                            preApproval.Name = reader.ReadElementContentAsString();
                            break;
                        case SerializerHelper.Tracker:
                            preApproval.Tracker = reader.ReadElementContentAsString();
                            break;
                        case SerializerHelper.Charge:
                            preApproval.Charge = reader.ReadElementContentAsString();
                            break;
                        default:
                            XMLParserUtils.SkipElement(reader);
                            break;
                    }
                }
                else
                {
                    XMLParserUtils.SkipNode(reader);
                }
            }
        }
コード例 #2
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="reader"></param>
        /// <param name="preApprovals"></param>
        internal static void Read(XmlReader reader, IList<PreApprovalSummary> preApprovals)
        {
            preApprovals.Clear();

            if (reader.IsEmptyElement)
            {
                XMLParserUtils.SkipNode(reader);
            }

            reader.ReadStartElement(PreApprovalSummaryListSerializer.PreApprovals);
            reader.MoveToContent();

            while (!reader.EOF)
            {

                if (XMLParserUtils.IsEndElement(reader, PreApprovalSummaryListSerializer.PreApprovals))
                {
                    XMLParserUtils.SkipNode(reader);
                    break;
                }

                if (reader.NodeType == XmlNodeType.Element)
                {
                    PreApprovalSummary preApproval = new PreApprovalSummary();
                    switch (reader.Name)
                    {
                        case SerializerHelper.PreApproval:
                            PreApprovalSummarySerializer.Read(reader, preApproval);
                            preApprovals.Add(preApproval);
                            break;
                        default:
                            XMLParserUtils.SkipElement(reader);
                            break;
                    }
                }
                else
                {
                    XMLParserUtils.SkipNode(reader);
                }
            }
        }