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


C# XmlReader.ReadEndElement方法代码示例

本文整理汇总了C#中System.Xml.XmlReader.ReadEndElement方法的典型用法代码示例。如果您正苦于以下问题:C# XmlReader.ReadEndElement方法的具体用法?C# XmlReader.ReadEndElement怎么用?C# XmlReader.ReadEndElement使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Xml.XmlReader的用法示例。


在下文中一共展示了XmlReader.ReadEndElement方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ReadObject

 public override object ReadObject(XmlReader reader)
 {
     SimpleEventRequest SimpleEventRequestField = null;
     if (IsParentStartElement(reader, false, true))
     {
         SimpleEventRequestField = new SimpleEventRequest();
         SimpleEventRequestField.AnyAttr = ReadAnyAttribute(reader);
         reader.Read();
         if (IsChildStartElement(reader, "Param", true, true))
         {
             reader.Read();
             string[] Param_List = reader.ReadString().Split();
             if ((this._CompressByteArrays 
                         || ((Param_List.Length == 1) 
                         && (Param_List[0].Length > 2))))
             {
                 SimpleEventRequestField.Param = Convert.FromBase64String(Param_List[0]);
             }
             else
             {
                 SimpleEventRequestField.Param = new byte[Param_List.Length];
                 for (int i = 0; (i < Param_List.Length); i = (i + 1))
                 {
                     SimpleEventRequestField.Param[i] = XmlConvert.ToByte(Param_List[i]);
                 }
             }
             reader.ReadEndElement();
         }
         SimpleEventRequestField.Any = ReadAnyElement(reader, false);
         reader.ReadEndElement();
     }
     return SimpleEventRequestField;
 }
开发者ID:koson,项目名称:.NETMF_for_LPC17xx,代码行数:33,代码来源:EventingService.cs

示例2: ReadXml

		public override void ReadXml(XmlReader reader)
		{
			reader.MoveToContent();
			if (reader.AttributeCount == 0)
				throw new MissingXmlAttributeException(@"Missing XML attribute ""value"".");
			Name = reader["name"];

			if (reader.IsEmptyElement)
			{
				reader.ReadEndElement();
				return;
			}


			if (reader.ReadToDescendant(ChildXmlTag))
			{
				while (reader.MoveToContent() == XmlNodeType.Element && reader.LocalName == ChildXmlTag)
				{
					reader.ReadStartElement();
					reader.MoveToContent();

					IilParameter p = IilParameter.fromString(reader.LocalName);
					p.ReadXml(reader);
					Parameters.Add(p);
					reader.ReadEndElement();
				}
			}
			
            
			reader.ReadEndElement();
			//reader.Read();
		}
开发者ID:jannickj,项目名称:multipacman,代码行数:32,代码来源:IilDataContainer.cs

示例3: Read

        public bool Read(XmlReader reader)
        {
            if(reader.IsStartElement() && reader.Name == "Fixture") {
                Fixture fixture = new Fixture();

                //...Any attributes go here...
                fixture.AllowFrameSkip = bool.Parse(reader.GetAttribute("allowFrameSkip"));
                fixture.Name = reader.GetAttribute("name");
                // This needs to hold off until after channels are loaded.
                string fixtureDefinitionName = reader.GetAttribute("fixtureDefinitionName");

                if(reader.ElementsExistWithin("Fixture")) { // Entity element
                    // Channels
                    if(reader.ElementsExistWithin("Channels")) { // Container element for child entity
                        ChannelReader<OutputChannel> channelReader = new ChannelReader<OutputChannel>();
                        while(channelReader.Read(reader)) {
                            fixture.InsertChannel(channelReader.Channel);
                        }
                        reader.ReadEndElement(); // Channels
                    }

                    // With channels loaded, the fixture template reference can be set.
                    fixture.FixtureDefinitionName = fixtureDefinitionName;

                    reader.ReadEndElement(); // Fixture

                    this.Fixture = fixture;
                }
                return true;
            }
            return false;
        }
开发者ID:stewmc,项目名称:vixen,代码行数:32,代码来源:FixtureReader.cs

示例4: ReadXml

 public void ReadXml(XmlReader reader)
 {
     if (reader.IsEmptyElement) return;
     reader.ReadStartElement("CommandCollection");
     reader.ReadStartElement("Commands");
     while(reader.NodeType != XmlNodeType.EndElement)
     {
         var c = new Command();
         switch(reader.Name)
         {
             case "AttackCommand":
                 _mutableSerializer = new XmlSerializer(typeof(AttackCommand));
                 c = (AttackCommand)_mutableSerializer.Deserialize(reader);
                 Commands.Add(c);
                 break;
             case "TimedCommand":
                 _mutableSerializer = new XmlSerializer(typeof(TimedCommand));
                 c = (TimedCommand)_mutableSerializer.Deserialize(reader);
                 Commands.Add(c);
                 break;
         }
     }
     reader.ReadEndElement();
     reader.ReadEndElement();
 }
开发者ID:arlenner,项目名称:EnterTheArena,代码行数:25,代码来源:CommandManager.cs

示例5: ReadObject

 public override object ReadObject(XmlReader reader)
 {
     OneWayAttachmentRequest OneWayAttachmentRequestField = null;
     if (IsParentStartElement(reader, false, true))
     {
         OneWayAttachmentRequestField = new OneWayAttachmentRequest();
         OneWayAttachmentRequestField.AnyAttr = ReadAnyAttribute(reader);
         reader.Read();
         if (IsChildStartElement(reader, "Param", true, true))
         {
             reader.Read();
             if (IsAttribute(reader, "href"))
             {
                 string contentID;
                 contentID = reader.Value;
                 reader.MoveToElement();
                 reader.ReadStartElement("Include", "http://www.w3.org/2004/08/xop/include");
                 reader.ReadEndElement();
                 OneWayAttachmentRequestField.Param = GetBodyPartContent(contentID, BodyParts);
             }
             else
             {
                 OneWayAttachmentRequestField.Param = Convert.FromBase64String(reader.ReadString());
                 reader.ReadEndElement();
             }
         }
         OneWayAttachmentRequestField.Any = ReadAnyElement(reader, false);
         reader.ReadEndElement();
     }
     return OneWayAttachmentRequestField;
 }
开发者ID:koson,项目名称:.NETMF_for_LPC17xx,代码行数:31,代码来源:AttachmentService.cs

示例6: ReadXml

        public void ReadXml(XmlReader reader)
        {
            // Start to use the reader.
            reader.Read();
            // Read the first element ie root of this object
            reader.ReadStartElement("dictionary");

            // Read all elements
            while (reader.NodeType != XmlNodeType.EndElement)
            {
                // parsing the item
                reader.ReadStartElement("item");

                // PArsing the key and value
                string key = reader.ReadElementString("key");
                string value = reader.ReadElementString("value");

                // en reading the item.
                reader.ReadEndElement();
                reader.MoveToContent();

                // add the item
                Add(key, value);
            }

            // Extremely important to read the node to its end.
            // next call of the reader methods will crash if not called.
            reader.ReadEndElement();
        }
开发者ID:hiriumi,项目名称:EasyReporting,代码行数:29,代码来源:SerializableHashtable.cs

示例7: FromXml

        public bool FromXml(XmlReader reader)
        {
            if (reader.Name != "Node")
            {
                return false;
            }

            reader.ReadStartElement();

            Rounds = new List<Round>();
            if (reader.Name == "Rounds")
            {
                reader.ReadStartElement();

                Round round;
                while (reader.Name == "Round")
                {
                    round = new Round();
                    if (!round.FromXml(reader))
                    {
                        return false;
                    }
                    Rounds.Add(round);
                }

                if (reader.Name == "Rounds" && reader.NodeType == XmlNodeType.EndElement)
                {
                    reader.ReadEndElement();
                }
            }

            Items = new List<Item>();
            if (reader.Name == "Items")
            {
                reader.ReadStartElement();

                Item item;
                while (reader.Name == "Item")
                {
                    item = new Item();
                    if (!item.FromXml(reader))
                    {
                        return false;
                    }
                    Items.Add(item);
                }

                if (reader.Name == "Items" && reader.NodeType == XmlNodeType.EndElement)
                {
                    reader.ReadEndElement();
                }
            }

            if (reader.Name == "Node" && reader.NodeType == XmlNodeType.EndElement)
            {
                reader.ReadEndElement();
            }
            return true;
        }
开发者ID:burstas,项目名称:rmps,代码行数:59,代码来源:Node.cs

示例8: ReadXml

 public void ReadXml(XmlReader reader)
 {
     reader.ReadStartElement(typeof(infNFeSupl).Name);
     reader.ReadStartElement("qrCode");
     qrCode = reader.ReadString();
     reader.ReadEndElement();
     reader.ReadEndElement();
 }
开发者ID:luispelin,项目名称:Zeus.Net.NFe.NFCe,代码行数:8,代码来源:infNFeSupl.cs

示例9: ReadXml

 public override void ReadXml(XmlReader reader)
 {
     reader.ReadStartElement();
     reader.ReadStartElement("X");
     var x = reader.ReadContentAsDouble();
     reader.ReadEndElement();
     reader.ReadStartElement("Y");
     var y = reader.ReadContentAsDouble();
     reader.ReadEndElement();
     Value = new Point(x, y);
     reader.ReadEndElement();
 }
开发者ID:OronDF343,项目名称:Sky-Jukebox,代码行数:12,代码来源:PointProperty.cs

示例10: Read

        /// <summary>
        ///   Reads the next blueprint from the specified reader.
        /// </summary>
        /// <param name="reader">Reader to read the next blueprint from.</param>
        /// <returns>Read blueprint.</returns>
        public Blueprint Read(XmlReader reader)
        {
            reader.Read();
            reader.Read();

            var blueprintId = reader[BlueprintIdAttributeName];
            var blueprint = new Blueprint(blueprintId);

            // Read blueprint id.
            reader.ReadStartElement(BlueprintElementName);
            {
                // Read property values.
                reader.ReadStartElement(PropertyValuesElementName);
                {
                    while (reader.IsStartElement(PropertyElementName))
                    {
                        var key = reader[PropertyKeyAttributeName];
                        var typeName = reader[PropertyTypeAttributeName];
                        var type = Type.GetType(typeName);

                        reader.ReadStartElement(PropertyElementName);
                        {
                            var value =
                                new XmlSerializer(type, new XmlRootAttribute(PropertyValueElementName)).Deserialize(
                                    reader);

                            // Add to blueprint.
                            blueprint.PropertyValues.Add(key, value);
                        }
                        reader.ReadEndElement();
                    }
                }
                reader.ReadEndElement();

                // Read components.
                reader.ReadStartElement(ComponentsElementName);
                {
                    while (reader.IsStartElement(ComponentElementName))
                    {
                        var component = reader.ReadElementContentAsString();

                        // Add to blueprint.
                        blueprint.ComponentTypes.Add(component);
                    }
                }
                reader.ReadEndElement();
            }
            reader.ReadEndElement();

            return blueprint;
        }
开发者ID:npruehs,项目名称:Entitas-Blueprints-CSharp,代码行数:56,代码来源:BlueprintXmlSerializer.cs

示例11: while

 /// <summary>
 /// Generates an object from its XML representation.
 /// </summary>
 /// <param name="reader">The <see cref="T:System.Xml.XmlReader"></see> stream from which the object is deserialized.</param>
 void IXmlSerializable.ReadXml(XmlReader reader)
 {
     reader.Read();
       reader.ReadStartElement("dictionary");
       while (reader.NodeType != XmlNodeType.EndElement) {
     reader.ReadStartElement("item");
     string key = reader.ReadElementString("key");
     string value = reader.ReadElementString("value");
     reader.ReadEndElement();
     reader.MoveToContent();
     this.Add(key, value);
       }
       reader.ReadEndElement();
 }
开发者ID:montyclift,项目名称:dashcommerce-3,代码行数:18,代码来源:ExtendedProperties.cs

示例12: ReadXml

 public override void ReadXml(XmlReader reader)
 {
     reader.MoveToContent();
     var isEmpty = reader.IsEmptyElement;
     reader.ReadStartElement();
     if (!isEmpty)
     {
         reader.ReadStartElement("Title");
         Title = reader.ReadContentAsString();
         reader.ReadEndElement();
         OnlineResource.ReadXml(reader);
         LogoURL.ReadXml(reader);
         reader.ReadEndElement();
     }
 }
开发者ID:galchen,项目名称:brutile,代码行数:15,代码来源:Attribution.cs

示例13: Deserialize

        /// <summary>
        /// Deserializes an ChangedItem from an XML file.
        /// </summary>
        /// <param name="reader">XMLReader where the ChangedItem is.</param>
        /// <returns>ChangedItem.</returns>
        public static ChangedItem Deserialize(XmlReader reader)
        {
            ChangedItem lResult = null;
            if (reader.IsStartElement(DTD.Error.ChangedItems.TagChangedItem))
            {
                lResult = new ChangedItem();
                string stringModelType = reader.GetAttribute(DTD.Error.ChangedItems.ChangedItem.TagType);
                ModelType modelType = Convert.StringTypeToMODELType(stringModelType);

                if (modelType == ModelType.Oid)
                {
                    lResult.Type = Convert.MODELTypeToStringType(ModelType.Oid);
                    lResult.ClassName = stringModelType;
                }
                else
                {
                    lResult.Type = stringModelType;
                    lResult.ClassName = string.Empty;
                }
                lResult.Name = reader.GetAttribute(DTD.Error.ChangedItems.ChangedItem.TagName);

                if (!reader.IsEmptyElement)
                {
                    reader.ReadStartElement();

                    if (reader.IsStartElement(DTD.Error.ChangedItems.ChangedItem.TagChangedItemOldValue))
                    {
                        lResult.OldValue =  XMLChangedItemValueSerializer.Deserialize(reader.ReadSubtree(),lResult.Type, lResult.ClassName);
                        reader.ReadEndElement();
                    }

                    if (reader.IsStartElement(DTD.Error.ChangedItems.ChangedItem.TagChangedItemNewValue))
                    {
                        lResult.NewValue = XMLChangedItemValueSerializer.Deserialize(reader.ReadSubtree(), lResult.Type, lResult.ClassName);
                        reader.ReadEndElement();
                    }
                }
                else
                {
                    reader.Skip();
                }
            }
            else
            {
                throw new ArgumentException("Xml Reader don't have the ChangedItem in Start Element.", "XmlReader reader");
            }
            return lResult;
        }
开发者ID:sgon1853,项目名称:UPM_MDD_Thesis,代码行数:53,代码来源:ChangedItems.Serializer.cs

示例14: ReadXml

        public void ReadXml(XmlReader reader)
        {
            bool isEmpty = reader.IsEmptyElement;

            AddAttributeExtensions(reader);

            reader.ReadStartElement();

            if (!isEmpty)
            {
                while (reader.IsStartElement())
                {
                    if (reader.LocalName == Backlink.ELEMENT_NAME)
                    {
                        if (BacklinkItems == null)
                        {
                            BacklinkItems = new List<Backlink>();
                        }
                        var backlink = new Backlink();
                        backlink.ReadXml(reader);

                        BacklinkItems.Add(backlink);
                    }
                    else
                    {
                        ElementExtensions.Add((XElement)XNode.ReadFrom(reader));
                    }
                }
            }
            reader.ReadEndElement();
        }
开发者ID:amirhalatzi,项目名称:MediaRssSharp,代码行数:31,代码来源:Backlinks.cs

示例15: ReadXml

 public override void ReadXml(XmlReader reader)
 {
     reader.ReadStartElement("RemovePortCommand", Context.YttriumNamespace);
     base.ReadXml(reader);
     _isolate = bool.Parse(reader.ReadElementString("Isolate"));
     reader.ReadEndElement();
 }
开发者ID:xuchuansheng,项目名称:GenXSource,代码行数:7,代码来源:RemovePortCommand.cs


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