Sage Modeling and Simulation Library

SmartPropertyBag..::..GetEnumerator Method

Retrieves an enumerator that cycles through all of the entries in this SPB. If the entry is not a leaf node, then it can have its enumerator invoked, allowing that entry's child list to be walked, and so forth.

C#
private void DumpEnumerable( IEnumerable enumerable, int depth ) {
       foreach ( HierarchicalDictionaryEntry hde in enumerable ) {
           for ( int i = 0 ; i < depth ; i++ ) Trace.Write("\t");
           Trace.Write(hde.Key.ToString() + ", ");
           Trace.Write(hde.Value.GetType() + ", ");
           if ( hde.IsLeaf ) {
               Trace.Write(hde.Value.ToString());
               if ( hde.Value is double ) {
                    _Debug.WriteLine(" <NOTE: this is a double.>");
               } else {
                   _Debug.WriteLine("");
               }
           } else {
               _Debug.WriteLine("");
               DumpEnumerable((IEnumerable)hde.Value,depth+1);
           }
       }

Namespace:  Highpoint.Sage.SimCore
Assembly:  Sage4 (in Sage4.dll)

Syntax


public IEnumerator GetEnumerator()

Return Value

An enumerator that cycles through all of the entries in this SPB.