本文整理汇总了C#中System.Xml.XmlDictionaryReader.IsStartArray方法的典型用法代码示例。如果您正苦于以下问题:C# XmlDictionaryReader.IsStartArray方法的具体用法?C# XmlDictionaryReader.IsStartArray怎么用?C# XmlDictionaryReader.IsStartArray使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Xml.XmlDictionaryReader
的用法示例。
在下文中一共展示了XmlDictionaryReader.IsStartArray方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: WriteNode
public virtual void WriteNode(XmlDictionaryReader reader, bool defattr)
{
XmlNodeType type;
if (reader == null)
{
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentNullException("reader"));
}
int num = (reader.NodeType == XmlNodeType.None) ? -1 : reader.Depth;
Label_002A:
type = reader.NodeType;
switch (type)
{
case XmlNodeType.Text:
case XmlNodeType.Whitespace:
case XmlNodeType.SignificantWhitespace:
this.WriteTextNode(reader, false);
goto Label_0136;
default:
Type type2;
if ((reader.Depth > num) && reader.IsStartArray(out type2))
{
this.WriteArrayNode(reader, type2);
goto Label_0136;
}
switch (type)
{
case XmlNodeType.Element:
this.WriteElementNode(reader, defattr);
goto Label_012D;
case XmlNodeType.CDATA:
this.WriteCData(reader.Value);
goto Label_012D;
case XmlNodeType.EntityReference:
this.WriteEntityRef(reader.Name);
goto Label_012D;
case XmlNodeType.ProcessingInstruction:
case XmlNodeType.XmlDeclaration:
this.WriteProcessingInstruction(reader.Name, reader.Value);
goto Label_012D;
case XmlNodeType.Comment:
this.WriteComment(reader.Value);
goto Label_012D;
case XmlNodeType.DocumentType:
this.WriteDocType(reader.Name, reader.GetAttribute("PUBLIC"), reader.GetAttribute("SYSTEM"), reader.Value);
goto Label_012D;
case XmlNodeType.EndElement:
this.WriteFullEndElement();
goto Label_012D;
}
break;
}
Label_012D:
if (!reader.Read())
{
return;
}
Label_0136:
if ((num < reader.Depth) || ((num == reader.Depth) && (reader.NodeType == XmlNodeType.EndElement)))
{
goto Label_002A;
}
}
示例2: WriteNode
public virtual void WriteNode(XmlDictionaryReader reader, bool defattr)
{
if (reader == null)
throw System.Runtime.Serialization.DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentNullException("reader"));
int d = (reader.NodeType == XmlNodeType.None ? -1 : reader.Depth);
do
{
XmlNodeType nodeType = reader.NodeType;
Type type;
if (nodeType == XmlNodeType.Text || nodeType == XmlNodeType.Whitespace || nodeType == XmlNodeType.SignificantWhitespace)
{
// This will advance if necessary, so we don't need to call Read() explicitly
WriteTextNode(reader, false);
}
else if (reader.Depth > d && reader.IsStartArray(out type))
{
WriteArrayNode(reader, type);
}
else
{
// These will not advance, so we must call Read() explicitly
switch (nodeType)
{
case XmlNodeType.Element:
WriteElementNode(reader, defattr);
break;
case XmlNodeType.CDATA:
WriteCData(reader.Value);
break;
case XmlNodeType.EntityReference:
WriteEntityRef(reader.Name);
break;
case XmlNodeType.XmlDeclaration:
case XmlNodeType.ProcessingInstruction:
WriteProcessingInstruction(reader.Name, reader.Value);
break;
case XmlNodeType.DocumentType:
WriteDocType(reader.Name, reader.GetAttribute("PUBLIC"), reader.GetAttribute("SYSTEM"), reader.Value);
break;
case XmlNodeType.Comment:
WriteComment(reader.Value);
break;
case XmlNodeType.EndElement:
WriteFullEndElement();
break;
}
if (!reader.Read())
break;
}
}
while (d < reader.Depth || (d == reader.Depth && reader.NodeType == XmlNodeType.EndElement));
}