本文整理汇总了C#中System.Runtime.Serialization.XmlReaderDelegator.MoveToAttribute方法的典型用法代码示例。如果您正苦于以下问题:C# XmlReaderDelegator.MoveToAttribute方法的具体用法?C# XmlReaderDelegator.MoveToAttribute怎么用?C# XmlReaderDelegator.MoveToAttribute使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Runtime.Serialization.XmlReaderDelegator
的用法示例。
在下文中一共展示了XmlReaderDelegator.MoveToAttribute方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TryReadNullAtTopLevel
protected static bool TryReadNullAtTopLevel(XmlReaderDelegator reader)
{
while (reader.MoveToAttribute("type") && (reader.Value == "null"))
{
reader.Skip();
reader.MoveToElement();
return true;
}
reader.MoveToElement();
return false;
}
示例2: TryReadNullAtTopLevel
protected static bool TryReadNullAtTopLevel(XmlReaderDelegator reader)
{
while (reader.MoveToAttribute(JsonGlobals.typeString) && (reader.Value == JsonGlobals.nullString))
{
reader.Skip();
reader.MoveToElement();
return true;
}
reader.MoveToElement();
return false;
}
示例3: ReadAttributes
internal override void ReadAttributes(XmlReaderDelegator xmlReader)
{
if (attributes == null)
attributes = new Attributes();
attributes.Reset();
if (xmlReader.MoveToAttribute(JsonGlobals.typeString) && xmlReader.Value == JsonGlobals.nullString)
{
attributes.XsiNil = true;
}
else if (xmlReader.MoveToAttribute(JsonGlobals.serverTypeString))
{
XmlQualifiedName qualifiedTypeName = JsonReaderDelegator.ParseQualifiedName(xmlReader.Value);
attributes.XsiTypeName = qualifiedTypeName.Name;
string serverTypeNamespace = qualifiedTypeName.Namespace;
if (!string.IsNullOrEmpty(serverTypeNamespace))
{
switch (serverTypeNamespace[0])
{
case '#':
serverTypeNamespace = string.Concat(Globals.DataContractXsdBaseNamespace, serverTypeNamespace.Substring(1));
break;
case '\\':
if (serverTypeNamespace.Length >= 2)
{
switch (serverTypeNamespace[1])
{
case '#':
case '\\':
serverTypeNamespace = serverTypeNamespace.Substring(1);
break;
default:
break;
}
}
break;
default:
break;
}
}
attributes.XsiTypeNamespace = serverTypeNamespace;
}
xmlReader.MoveToElement();
}
示例4: TryGetJsonLocalName
internal static bool TryGetJsonLocalName(XmlReaderDelegator xmlReader, out string name)
{
if (xmlReader.IsStartElement(JsonGlobals.itemDictionaryString, JsonGlobals.itemDictionaryString))
{
if (xmlReader.MoveToAttribute(JsonGlobals.itemString))
{
name = xmlReader.Value;
return true;
}
}
name = null;
return false;
}