/// <summary> /// /// </summary> /// <param name="reader"></param> /// <param name="permission">PagSeguro AuthorizationPermissions</param> internal static void Read(XmlReader reader, AuthorizationPermissions permission) { if (reader.IsEmptyElement) { XMLParserUtils.SkipNode(reader); return; } reader.ReadStartElement(SerializerHelper.Permission); reader.MoveToContent(); while (!reader.EOF) { if (XMLParserUtils.IsEndElement(reader, SerializerHelper.Permission)) { XMLParserUtils.SkipNode(reader); break; } if (reader.NodeType == XmlNodeType.Element) { switch (reader.Name) { case SerializerHelper.Code: permission.Code = reader.ReadElementContentAsString(); break; case SerializerHelper.Status: permission.Status = reader.ReadElementContentAsString(); break; case SerializerHelper.LastUpdate: permission.LastUpdate = reader.ReadElementContentAsDateTime(); break; default: XMLParserUtils.SkipElement(reader); break; } } else { XMLParserUtils.SkipNode(reader); } } }
/// <summary> /// /// </summary> /// <param name="reader"></param> /// <param name="permissions">PagSeguro AuthorizationPermissions List</param> internal static void Read(XmlReader reader, IList<AuthorizationPermissions> permissions) { permissions.Clear(); if (reader.IsEmptyElement) { XMLParserUtils.SkipNode(reader); } reader.ReadStartElement(SerializerHelper.Permissions); reader.MoveToContent(); while (!reader.EOF) { if (XMLParserUtils.IsEndElement(reader, SerializerHelper.Permissions)) { XMLParserUtils.SkipNode(reader); break; } if (reader.NodeType == XmlNodeType.Element) { AuthorizationPermissions permission = new AuthorizationPermissions(); switch (reader.Name) { case SerializerHelper.Permission: AuthorizationPermissionSerializer.Read(reader, permission); permissions.Add(permission); break; default: XMLParserUtils.SkipElement(reader); break; } } else { XMLParserUtils.SkipNode(reader); } } }