예제 #1
0
 public void DisplayGeometryRecords(object[] records)
 {
     if (records.GetType() == typeof(Point[]))
     {
         Point point = new Point();
         point.DisplayPoint((Point[])records);
     }
     else if (records.GetType() == typeof(Multipoint[]))
     {
         Multipoint multipoint = new Multipoint();
         //multipoint.DisplayMultipoints((Multipoint[])records);
     }
     else if (records.GetType() == typeof(Polyline[]))
     {
         Polyline polyline = new Polyline();
         polyline.DisplayPolylines(records);
     }
     else if (records.GetType() == typeof(Polygon[]))
     {
         Polygon polygon = new Polygon();
         polygon.DisplayPolygons((Polygon[])records);
     }
     else
     {
         Console.WriteLine("Type \"{0}\" not recognized.", records.GetType());
     }
 }
예제 #2
0
 public Multipoint[] RecordsToMultipointGeometry(List <MainRecord> records)
 {
     Multipoint[] multipoints = new Multipoint[records.Count];
     for (int i = 0; i < records.Count; i++)
     {
         int     numPoints = BitConverter.ToInt32(records[i].RecordContents, 36);
         Point[] points    = new Point[numPoints];
         for (int j = 0; j < numPoints; j++)
         {
             points[j] = new Point(BitConverter.ToDouble(records[i].RecordContents, (j * 16) + 40), BitConverter.ToDouble(records[i].RecordContents, (j * 16) + 48));
         }
         multipoints[i] = new Multipoint(points);
     }
     return(multipoints);
 }