public void GetValues(ref List <object> listOfValues) { if (!(this.Value is BinFileValueList)) { listOfValues.Add(this); } else { BinFileValueList binFileValueList = (BinFileValueList)this.Value; listOfValues.Add(binFileValueList); try { List <BinFileValue> .Enumerator enumerator = binFileValueList.Entries.GetEnumerator(); while (enumerator.MoveNext()) { BinFileValue current = enumerator.Current; current.GetValues(ref listOfValues); } } finally { } listOfValues.Add(binFileValueList); } }
public List <object> EnumerateValues() { List <object> list = new List <object>(); try { List <BinFileEntry> .Enumerator enumerator = this.Entries.GetEnumerator(); while (enumerator.MoveNext()) { BinFileEntry current = enumerator.Current; list.Add(current); try { List <BinFileValue> .Enumerator enumerator2 = current.Values.GetEnumerator(); while (enumerator2.MoveNext()) { BinFileValue current2 = enumerator2.Current; current2.GetValues(ref list); } } finally { ((IDisposable)enumerator).Dispose(); } list.Add(current); } } finally { ((IDisposable)list).Dispose(); } return(list); }