private void UdpLaserListener_IncomingData(object sender, byte[] e) { int position = 0; if (e != null) { GCCollection gCElements = new GCCollection(); FileParser fileParser = new FileParser(e); string hdr = fileParser.parseString(4); if (hdr.Equals("2CUT") == false) { return; } //Bytes 4-6: Reserved fileParser.Skip(3); int PathCount = fileParser.parseShort(); for (int p = 0; p < PathCount; p++) { PointsElement points = new PointsElement(); points.IsClosed = fileParser.parseByte() == 0 ? false : true; int pointsCount = fileParser.parseShort(); for (int i = 0; i < pointsCount; i++) { points.Add(new GCPoint3D(fileParser.parseShort(), -fileParser.parseShort(), 0)); } if (points.Points.Count > 0) { gCElements.Add(points); } } ContourScrollPanel.Add(false, gCElements, "Ethernet"); } }