public void Read(BinaryReader reader) { this.Box[0] = reader.ReadDouble(); this.Box[1] = reader.ReadDouble(); this.Box[2] = reader.ReadDouble(); this.Box[3] = reader.ReadDouble(); this.NumPoints = reader.ReadInt32(); this.Points = new ShapePoint[this.NumPoints]; for (int i = 0; i < this.NumPoints; i++) { ShapePoint shapePoint = new ShapePoint(); shapePoint.Read(reader); this.Points[i] = shapePoint; } }
public void ReadShapes(BinaryReader reader) { while (reader.BaseStream.Length != reader.BaseStream.Position) { this.SwapBytes(reader.ReadInt32()); this.SwapBytes(reader.ReadInt32()); switch (reader.ReadInt32()) { case 1: { ShapePoint shapePoint = new ShapePoint(); shapePoint.Read(reader); this.Points.Add(shapePoint); break; } case 8: { MultiPoint multiPoint = new MultiPoint(); multiPoint.Read(reader); this.MultiPoints.Add(multiPoint); break; } case 3: { PolyLine polyLine2 = new PolyLine(); polyLine2.Read(reader); this.PolyLines.Add(polyLine2); break; } case 5: { PolyLine polyLine = new PolyLine(); polyLine.Read(reader); this.Polygons.Add(polyLine); break; } } } }