コード例 #1
0
ファイル: BinFileEntry.cs プロジェクト: FateNineMeow/LuMei
 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
     {
     }
 }
コード例 #2
0
 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
             {
             }
         }
     }
 }