private void method_1(ICoFeature icoFeature_0, IGeometry igeometry_0) { ICoPolylineFeature feature = icoFeature_0 as ICoPolylineFeature; IPolyline polyline = igeometry_0 as IPolyline; if ((feature != null) && (polyline != null)) { IGeometryCollection geometrys = polyline as IGeometryCollection; if (geometrys != null) { for (int i = 0; i < geometrys.GeometryCount; i++) { CoPointCollection item = new CoPointCollection(); IPointCollection points2 = geometrys.get_Geometry(i) as IPointCollection; if (points2 != null) { for (int j = 0; j < points2.PointCount; j++) { IPoint point = points2.get_Point(j); item.Add(new CoPointClass(point.X, point.Y, point.Z)); } feature.Points.Add(item); } } } } }
private void method_2(ICoFeature icoFeature_0) { try { int[] numArray; ShapeLib.PartType[] typeArray; int num5; int count = 0; int num2 = 0; int num3 = 0; int index = 0; switch (icoFeature_0.Type) { case CoFeatureType.Point: foreach (ICoPoint point in (icoFeature_0 as ICoPointFeature).Point) { this.double_0 = new double[1]; this.double_1 = new double[1]; this.double_0[0] = point.X; this.double_1[0] = point.Y; this.intptr_2 = ShapeLib.SHPCreateObject(this.shapeType_0, -1, 0, null, null, 1, this.double_0, this.double_1, null, null); num2 = ShapeLib.SHPWriteObject(this.intptr_0, -1, this.intptr_2); ShapeLib.SHPDestroyObject(this.intptr_2); this.method_3(icoFeature_0, num2); } return; case CoFeatureType.Line: case CoFeatureType.Annotation: return; case CoFeatureType.Polygon: { ICoPolygonFeature feature2 = icoFeature_0 as ICoPolygonFeature; if (feature2 != null) { count = feature2.Points.Count; numArray = new int[count]; typeArray = new ShapeLib.PartType[count]; typeArray[0] = ShapeLib.PartType.Ring; numArray[0] = 0; num3 = feature2.Points[0].Count; for (num5 = 1; num5 < count; num5++) { numArray[num5] = num3; typeArray[num5] = ShapeLib.PartType.Ring; num3 += feature2.Points[num5].Count; } this.double_0 = new double[num3]; this.double_1 = new double[num3]; int num6 = 0; foreach (CoPointCollection points in feature2.Points) { int num8; double num7 = this.method_8(points); if (num6 == 0) { if (num7 > 0.0) { foreach (ICoPoint point2 in points) { this.double_0[index] = point2.X; this.double_1[index] = point2.Y; index++; } } else { num8 = points.Count - 1; while (num8 >= 0) { this.double_0[index] = points[num8].X; this.double_1[index] = points[num8].Y; index++; num8--; } } } else if (num7 > 0.0) { for (num8 = points.Count - 1; num8 >= 0; num8--) { this.double_0[index] = points[num8].X; this.double_1[index] = points[num8].Y; index++; } } else { foreach (ICoPoint point2 in points) { this.double_0[index] = point2.X; this.double_1[index] = point2.Y; index++; } } num6++; } this.intptr_2 = ShapeLib.SHPCreateObject(this.shapeType_0, -1, count, numArray, typeArray, num3, this.double_0, this.double_1, null, null); try { num2 = ShapeLib.SHPWriteObject(this.intptr_0, -1, this.intptr_2); ShapeLib.SHPDestroyObject(this.intptr_2); this.method_3(icoFeature_0, num2); } catch { } } return; } case CoFeatureType.Polyline: break; default: return; } ICoPolylineFeature feature = icoFeature_0 as ICoPolylineFeature; count = feature.Points.Count; numArray = new int[count]; typeArray = new ShapeLib.PartType[count]; typeArray[0] = ShapeLib.PartType.Ring; numArray[0] = 0; num3 = feature.Points[0].Count; for (num5 = 1; num5 < count; num5++) { numArray[num5] = num3; typeArray[num5] = ShapeLib.PartType.Ring; num3 += feature.Points[num5].Count; } this.double_0 = new double[num3]; this.double_1 = new double[num3]; foreach (CoPointCollection points in feature.Points) { foreach (ICoPoint point2 in points) { this.double_0[index] = point2.X; this.double_1[index] = point2.Y; index++; } } this.intptr_2 = ShapeLib.SHPCreateObject(this.shapeType_0, -1, count, numArray, typeArray, num3, this.double_0, this.double_1, null, null); num2 = ShapeLib.SHPWriteObject(this.intptr_0, -1, this.intptr_2); ShapeLib.SHPDestroyObject(this.intptr_2); this.method_3(icoFeature_0, num2); } finally { } }