本文整理汇总了C#中XmlTextReader.ReadToNextSibling方法的典型用法代码示例。如果您正苦于以下问题:C# XmlTextReader.ReadToNextSibling方法的具体用法?C# XmlTextReader.ReadToNextSibling怎么用?C# XmlTextReader.ReadToNextSibling使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类XmlTextReader
的用法示例。
在下文中一共展示了XmlTextReader.ReadToNextSibling方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: readConfig
void readConfig(string path)
{
int i = 0;
int j = 0;
int k = 0;
uint lastZoneTemp = 10;
uint firstZoneTemp;
XmlTextReader reader = new XmlTextReader(path);
{
while (reader.Read())
{
if (reader.IsStartElement())
{
switch (reader.NodeType)
{
case XmlNodeType.Element:
reader.ReadToFollowing("expander");//Configure Expanders
do
{
swampExpanderTypes[i] = reader.GetAttribute("Type");
expanderIDs[i] = Convert.ToUInt16(reader.GetAttribute("ID"));
if (swampExpanderTypes[i] == "swampE4")
{
lastZoneTemp += 4;
firstZoneTemp = lastZoneTemp - 3;
}
else
{
lastZoneTemp += 8;
firstZoneTemp = lastZoneTemp - 7;
}
expanderLastZone[i] = lastZoneTemp;
expanderFirstZone[i] = firstZoneTemp;
i++;
} while (reader.ReadToNextSibling("expander"));
numberOfExpanders = (ushort)i;
i = 0;
reader.ReadToFollowing("audioZone"); //Audio Zone Names & Numbers
do
{
zoneNameArray[i] = reader.GetAttribute("Name");
zoneNumberArray[i] = Convert.ToUInt16(reader.GetAttribute("zoneNumber"));
i++;
if (zoneNameArray[i] != " ")
{
k++;
}
} while (reader.ReadToNextSibling("audioZone"));
numberOfZones = (ushort)k;
i = 1;
reader.ReadToFollowing("audioSource"); //Audio Source Names & Numbers
sourceNameArray[0] = "Off";
do
{
sourceNameArray[i] = reader.GetAttribute("Name");
i++;
} while (reader.ReadToNextSibling("audioSource"));
i = 0;
reader.ReadToFollowing("group");//group numbers
do
{
groupNames[i] = reader.GetAttribute("Name");
reader.ReadToFollowing("zone");
do
{
UItoZone.zoneNumbersInGroups[i, j] = Convert.ToUInt16(reader.GetAttribute("zoneNumber"));//add zone numbers per floor/group
j++;
} while (reader.ReadToNextSibling("zone"));
UItoZone.groupSizes[i] = (ushort)j;//Number of zones in groups
j = 0;
i++;
} while (reader.ReadToNextSibling("group"));
UItoZone.numberOfGroups = i;
break;
} break;
}
}
}
}