Browse Source

fix deserialisation of consecutive integer ranges

pull/182/merge
Siegfried Pammer 14 years ago
parent
commit
0bfb193e47
  1. 17
      ILSpy.BamlDecompiler/Ricciolo.StylesExplorer.MarkupReflection/XmlBamlReader.cs

17
ILSpy.BamlDecompiler/Ricciolo.StylesExplorer.MarkupReflection/XmlBamlReader.cs

@ -776,34 +776,23 @@ namespace Ricciolo.StylesExplorer.MarkupReflection @@ -776,34 +776,23 @@ namespace Ricciolo.StylesExplorer.MarkupReflection
throw new ArgumentException();
Int32Collection ints = new Int32Collection(capacity);
switch (type)
{
switch (type) {
case IntegerCollectionType.Byte:
for (int i = 0; i < capacity; i++)
{
ints.Add(reader.ReadByte());
}
return ints;
case IntegerCollectionType.UShort:
for (int j = 0; j < capacity; j++)
{
ints.Add(reader.ReadUInt16());
}
return ints;
case IntegerCollectionType.Integer:
for (int k = 0; k < capacity; k++)
{
ints.Add(reader.ReadInt32());
}
return ints;
case IntegerCollectionType.Consecutive:
for (int m = reader.ReadInt32(); m < capacity; m++)
{
int start = reader.ReadInt32();
for (int m = start; m < capacity + start; m++)
ints.Add(m);
}
return ints;
}
throw new ArgumentException();

Loading…
Cancel
Save