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); }
public void Write(ref BinaryWriter bw) { bw.Write(this.Length); bw.Write(this.Prop.Hash); bw.Write(checked ((ushort)this.Values.Count)); try { List <BinFileValue> .Enumerator enumerator = this.Values.GetEnumerator(); while (enumerator.MoveNext()) { BinFileValue current = enumerator.Current; current.Write(ref bw, true); } } finally { } }
public void UpdateSizes() { uint num = 0u; checked { try { List <BinFileValue> .Enumerator enumerator = this.Values.GetEnumerator(); while (enumerator.MoveNext()) { BinFileValue current = enumerator.Current; num += current.UpdateSizes(); } } finally { } this.Length = (uint)(unchecked ((ulong)num) + 4uL + 2uL); } }
public void Write(ref BinaryWriter bw) { checked { if (this.ListType == BinFileValueType.SameTypeValuesList1) { bw.Write((byte)this.EntriesType); bw.Write(this.EntriesSize); bw.Write((uint)this.Entries.Count); try { List <BinFileValue> .Enumerator enumerator = this.Entries.GetEnumerator(); while (enumerator.MoveNext()) { BinFileValue current = enumerator.Current; current.Write(ref bw, false); } return; } finally { } } if (this.ListType == BinFileValueType.SameTypeValuesList2) { bw.Write((byte)this.EntriesType); bw.Write((byte)this.Entries.Count); try { List <BinFileValue> .Enumerator enumerator2 = this.Entries.GetEnumerator(); while (enumerator2.MoveNext()) { BinFileValue current2 = enumerator2.Current; current2.Write(ref bw, false); } return; } finally { } } if (this.ListType == BinFileValueType.ValuesList) { bw.Write(this.Prop.Hash); bw.Write(this.EntriesSize); bw.Write((ushort)this.Entries.Count); try { List <BinFileValue> .Enumerator enumerator3 = this.Entries.GetEnumerator(); while (enumerator3.MoveNext()) { BinFileValue current3 = enumerator3.Current; current3.Write(ref bw, true); } return; } finally { } } if (this.ListType == BinFileValueType.ValuesList2) { bw.Write(this.Prop.Hash); bw.Write(this.EntriesSize); bw.Write((ushort)this.Entries.Count); try { List <BinFileValue> .Enumerator enumerator4 = this.Entries.GetEnumerator(); while (enumerator4.MoveNext()) { BinFileValue current4 = enumerator4.Current; current4.Write(ref bw, true); } return; } finally { } } if (this.ListType == BinFileValueType.DoubleTypesValuesList) { bw.Write((byte)this.EntriesTypes[0]); bw.Write((byte)this.EntriesTypes[1]); bw.Write(this.EntriesSize); bw.Write((uint)Math.Round((double)this.Entries.Count / 2.0)); try { List <BinFileValue> .Enumerator enumerator5 = this.Entries.GetEnumerator(); while (enumerator5.MoveNext()) { BinFileValue current5 = enumerator5.Current; current5.Write(ref bw, false); } } finally { } } } }
public object UpdateSizes() { checked { object result; if (this.ListType == BinFileValueType.SameTypeValuesList1) { uint num = 0u; try { List <BinFileValue> .Enumerator enumerator = this.Entries.GetEnumerator(); while (enumerator.MoveNext()) { BinFileValue current = enumerator.Current; num += current.UpdateSizes(); } } finally { } this.EntriesSize = (uint)(unchecked ((ulong)num) + 4uL); result = (long)(9uL + unchecked ((ulong)num)); } else if (this.ListType == BinFileValueType.SameTypeValuesList2) { uint num2 = 0u; try { List <BinFileValue> .Enumerator enumerator2 = this.Entries.GetEnumerator(); while (enumerator2.MoveNext()) { BinFileValue current2 = enumerator2.Current; num2 += current2.UpdateSizes(); } } finally { } result = (long)(2uL + unchecked ((ulong)num2)); } else if (this.ListType == BinFileValueType.ValuesList) { uint num3 = 0u; try { List <BinFileValue> .Enumerator enumerator3 = this.Entries.GetEnumerator(); while (enumerator3.MoveNext()) { BinFileValue current3 = enumerator3.Current; num3 += current3.UpdateSizes(); } } finally { } if (unchecked ((ulong)this.EntriesSize) != unchecked ((ulong)num3) + 2uL) { num3 = num3; } this.EntriesSize = (uint)(unchecked ((ulong)num3) + 2uL); result = (long)(10uL + unchecked ((ulong)num3)); } else if (this.ListType == BinFileValueType.ValuesList2) { uint num4 = 0u; try { List <BinFileValue> .Enumerator enumerator4 = this.Entries.GetEnumerator(); while (enumerator4.MoveNext()) { BinFileValue current4 = enumerator4.Current; num4 += current4.UpdateSizes(); } } finally { } this.EntriesSize = (uint)(unchecked ((ulong)num4) + 2uL); result = (long)(10uL + unchecked ((ulong)num4)); } else if (this.ListType == BinFileValueType.DoubleTypesValuesList) { uint num5 = 0u; try { List <BinFileValue> .Enumerator enumerator5 = this.Entries.GetEnumerator(); while (enumerator5.MoveNext()) { BinFileValue current5 = enumerator5.Current; num5 += current5.UpdateSizes(); } } finally { } this.EntriesSize = (uint)(unchecked ((ulong)num5) + 4uL); result = (long)(10uL + unchecked ((ulong)num5)); } else { result = 0; } return(result); } }