本文整理汇总了C#中System.Xml.XmlTextReader.ReadElementContentAsInt方法的典型用法代码示例。如果您正苦于以下问题:C# System.Xml.XmlTextReader.ReadElementContentAsInt方法的具体用法?C# System.Xml.XmlTextReader.ReadElementContentAsInt怎么用?C# System.Xml.XmlTextReader.ReadElementContentAsInt使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Xml.XmlTextReader
的用法示例。
在下文中一共展示了System.Xml.XmlTextReader.ReadElementContentAsInt方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Unmarshall
public override WebServiceResponse Unmarshall(XmlUnmarshallerContext context)
{
System.Xml.XmlTextReader reader = new System.Xml.XmlTextReader(context.ResponseStream);
BatchReceiveMessageResponse batchReceiveMessageResponse = new BatchReceiveMessageResponse();
Message message = null;
while (reader.Read())
{
switch (reader.NodeType)
{
case System.Xml.XmlNodeType.Element:
switch (reader.LocalName)
{
case MNSConstants.XML_ROOT_MESSAGE:
message = new Message();
break;
case MNSConstants.XML_ELEMENT_MESSAGE_ID:
message.Id = reader.ReadElementContentAsString();
break;
case MNSConstants.XML_ELEMENT_RECEIPT_HANDLE:
message.ReceiptHandle = reader.ReadElementContentAsString();
break;
case MNSConstants.XML_ELEMENT_MESSAGE_BODY_MD5:
message.BodyMD5 = reader.ReadElementContentAsString();
break;
case MNSConstants.XML_ELEMENT_MESSAGE_BODY:
message.Body = reader.ReadElementContentAsString();
break;
case MNSConstants.XML_ELEMENT_ENQUEUE_TIME:
message.EnqueueTime = AliyunSDKUtils.ConvertFromUnixEpochSeconds(reader.ReadElementContentAsLong());
break;
case MNSConstants.XML_ELEMENT_NEXT_VISIBLE_TIME:
message.NextVisibleTime = AliyunSDKUtils.ConvertFromUnixEpochSeconds(reader.ReadElementContentAsLong());
break;
case MNSConstants.XML_ELEMENT_FIRST_DEQUEUE_TIME:
message.FirstDequeueTime = AliyunSDKUtils.ConvertFromUnixEpochSeconds(reader.ReadElementContentAsLong());
break;
case MNSConstants.XML_ELEMENT_DEQUEUE_COUNT:
message.DequeueCount = (uint)reader.ReadElementContentAsInt();
break;
case MNSConstants.XML_ELEMENT_PRIORITY:
message.Priority = (uint)reader.ReadElementContentAsInt();
break;
}
break;
case System.Xml.XmlNodeType.EndElement:
if (reader.LocalName == MNSConstants.XML_ROOT_MESSAGE)
{
batchReceiveMessageResponse.Messages.Add(message);
}
break;
}
}
reader.Close();
return batchReceiveMessageResponse;
}