本文整理汇总了C#中XmlReader.ElementsExistWithin方法的典型用法代码示例。如果您正苦于以下问题:C# XmlReader.ElementsExistWithin方法的具体用法?C# XmlReader.ElementsExistWithin怎么用?C# XmlReader.ElementsExistWithin使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类XmlReader
的用法示例。
在下文中一共展示了XmlReader.ElementsExistWithin方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ReadBody
protected override void ReadBody(XmlReader reader)
{
// This is duplicated from a Sequence, but that's to keep it independent.
// Just because that changes doesn't mean this should.
// Module data
reader.ReadStartElement("ModuleData");
ModuleDataSet.Deserialize(reader.ReadOuterXml());
reader.ReadEndElement(); // ModuleData
// Fixtures
if(reader.ElementsExistWithin("Fixtures")) { // Container element for child entity
FixtureReader fixtureReader = new FixtureReader();
while(fixtureReader.Read(reader)) {
InsertFixture(fixtureReader.Fixture);
}
reader.ReadEndElement(); // Fixtures
}
}
示例2: ReadBody
protected override void ReadBody(XmlReader reader)
{
// Channels
if(reader.ElementsExistWithin("Channels")) { // Container element for child entity
ChannelReader<OutputChannel> channelReader = new ChannelReader<OutputChannel>();
while(channelReader.Read(reader)) {
InsertChannel(channelReader.Channel);
}
reader.ReadEndElement(); // Channels
}
}