当前位置: 首页>>代码示例>>C#>>正文


C# XmlDictionaryReader.IsStartArray方法代码示例

本文整理汇总了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;
            }
        }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:69,代码来源:XmlDictionaryWriter.cs

示例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));
 }
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:52,代码来源:XmlDictionaryWriter.cs


注:本文中的System.Xml.XmlDictionaryReader.IsStartArray方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。