GetEnumerator() private method

private GetEnumerator ( ) : IEnumerator
return IEnumerator
Example #1
0
 public CustomProperty(object pSelectObject, XmlNodeList pObjectPropertys)
 {
     this.m_CurrentSelectObject = pSelectObject;
     IEnumerator tmpIe = pObjectPropertys.GetEnumerator();
     while (tmpIe.MoveNext())
     {
         this.AddAttribsList(tmpIe, pSelectObject);
     }
 }
Example #2
0
        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();
        }
Example #3
0
 /// <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 ) );
 }
Example #4
0
        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;
        }
Example #5
0
 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;
 }
Example #6
0
		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;
				}
			}
		}
Example #7
0
        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;
				}
			}
		}
		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");
		}
Example #9
0
		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;					
				}
			}
		}