本文整理汇总了C#中System.Xml.XmlNodeList.GetEnumerator方法的典型用法代码示例。如果您正苦于以下问题:C# XmlNodeList.GetEnumerator方法的具体用法?C# XmlNodeList.GetEnumerator怎么用?C# XmlNodeList.GetEnumerator使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Xml.XmlNodeList
的用法示例。
在下文中一共展示了XmlNodeList.GetEnumerator方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CustomProperty
public CustomProperty(object pSelectObject, XmlNodeList pObjectPropertys)
{
this.m_CurrentSelectObject = pSelectObject;
IEnumerator tmpIe = pObjectPropertys.GetEnumerator();
while (tmpIe.MoveNext())
{
this.AddAttribsList(tmpIe, pSelectObject);
}
}
示例2: AppendChildNodePairs
private string AppendChildNodePairs(XmlNodeList nodes)
{
StringBuilder sbPairs = new StringBuilder("");
IEnumerator IEnumChild = nodes.GetEnumerator();
while (IEnumChild.MoveNext())
{
XmlNode nodeChild = (XmlNode)IEnumChild.Current;
string strKey = nodeChild.Name;
string strVal = nodeChild.InnerText.Trim();
sbPairs.Append(strKey + " = " + strVal + strPairDelimiter);
}
return sbPairs.ToString();
}
示例3: ElementArrayFromNodeList
/// <summary>
/// Builds an array of XmlElements from an XmlNodeList
/// </summary>
/// <param name="list">an XmlNodeList</param>
/// <param name="filter">If true, returns only the elements with an "enabled" property set to "True" or "Yes"</param>
/// <returns>the array of elements</returns>
/// <remarks>
/// If there are no elements in the list or that are enabled, an empty array will be returned
/// </remarks>
public static XmlElement[] ElementArrayFromNodeList( XmlNodeList list,
bool filter )
{
ArrayList v = new ArrayList();
IEnumerator enumerator;
if ( filter ) {
enumerator = new FilteredElementList( list ).GetEnumerator();
}
else {
enumerator = list.GetEnumerator();
}
while ( enumerator.MoveNext() ) {
v.Add( enumerator.Current );
}
return (XmlElement []) v.ToArray( typeof ( XmlElement ) );
}
示例4: GetGpsPoints
private static IList<GpsTimePoint> GetGpsPoints(XmlNodeList nodes)
{
var retVal = new List<GpsTimePoint>();
var e = nodes.GetEnumerator();
while (e.MoveNext())
{
var utcTimepoint = ((XmlNode)e.Current).InnerText;
if (!e.MoveNext()) break;
var t = ((XmlNode)e.Current).InnerText.Split(new[] { ' ' });
if (t.Length < 2) continue;
retVal.Add(new GpsTimePoint(t[0], t[1], t.ElementAtOrDefault(2), utcTimepoint));
}
return retVal;
}
示例5: AddAll
public virtual bool AddAll(int index, XmlNodeList list)
{
bool result = false;
if (list != null)
{
IEnumerator tempEnumerator = list.GetEnumerator();
int tempIndex = index;
while (tempEnumerator.MoveNext())
{
base.Insert(tempIndex++, tempEnumerator.Current);
result = true;
}
}
return result;
}
示例6: ProcessChildren
protected void ProcessChildren(XmlNodeList l)
{
IEnumerator enumChildren = l.GetEnumerator();
while(enumChildren.MoveNext())
{
XmlNode c = (XmlNode) enumChildren.Current;
switch(c.Name)
{
case DMethod.IAM:
AddChild(new DMethod(c));
break;
case DParam.IAM:
DParam dparam = new DParam(c);
AddChild(dparam);
// check if this is a default property
if (dparam.HasDefaultValue)
m_defaultProp = new Property(Identifier, dparam.DefaultValue);
break;
}
}
}
示例7: ProcessChildren
protected void ProcessChildren(XmlNodeList l)
{
IEnumerator enumChildren = l.GetEnumerator();
while(enumChildren.MoveNext())
{
XmlNode c = (XmlNode) enumChildren.Current;
switch(c.Name)
{
case DMethod.IAM:
AddChild(new DMethod(c));
break;
case DProperty.IAM:
AddChild(new DProperty(c));
break;
case Event.IAM:
AddChild(new Event(c));
break;
// TODO: implemenent listener
case "listener":
break;
}
}
}
示例8: AssertNodeListEqual
void AssertNodeListEqual (XmlNodeList nl1, XmlNodeList nl2, string label)
{
Assert.AreEqual (nl1.Count, nl2.Count, label + ": node count");
IEnumerator e1, e2;
int i;
for (i = 0, e1 = nl1.GetEnumerator (), e2 = nl2.GetEnumerator (); e1.MoveNext (); i++) {
Assert.IsTrue (e2.MoveNext (), label + " : nl2.MoveNext");
Assert.AreEqual (e1.Current, e2.Current, label + " : node at " + i);
}
Assert.IsFalse (e2.MoveNext (), label + " : nl2 has extras");
}
示例9: ProcessChildren
protected void ProcessChildren(XmlNodeList l)
{
IEnumerator enumChildren = l.GetEnumerator();
while(enumChildren.MoveNext())
{
XmlNode c = (XmlNode) enumChildren.Current;
switch(c.Name)
{
case DMethod.IAM:
AddChild(new DMethod(c));
break;
}
}
}