65 string shapefilename = "Shape"; 66 _2 = shapefilename; 67 fedit.AliasName_2 = "形状";
68 fedit.Type_2 = esriFieldType.esriFieldTypeGeometry; 69 fedit.GeometryDef_2 = geodefedit; 70 fieldsedit.AddField((IField)fedit); 71
72 IFeatureClass ftclass;
73 ftclass = ftworkspace.CreateFeatureClass 74 (sfilename, fields, null, null, 75
esriFeatureType.esriFTSimple, "Shape", "");
76 if (ftclass == null) 77 return null; 78 return ftclass; 79 } 80
81 public bool addfeaturetomap 82
83 {
84 if (ftclass == null || slayername == null) 85 return false;
86 IFeatureLayer ftlayer = new FeatureLayerClass(); 87 ftlayer.FeatureClass = ftclass; 88 = slayername; 89 mmap.AddLayer(ftlayer as ILayer); 90 IActiveView act = mmap as IActiveView; 91 act.Refresh(); 92 return true; 93 } 94
95 public DataTable getcontNames() 96 {
97 ILayer layer = getlayerbyname("Continents");
98 IFeatureLayer featurelayer = layer as IFeatureLayer; 99 if (featurelayer == null) 100 return null; 101 IFeature feature;
102 IFeatureCursor featureCursor = featurelayer.Search(null, false); 103 feature = featureCursor.NextFeature(); 104 if(feature == null) 105 return null;
106 DataTable datatable = new DataTable(); 107 DataColumn datacolum = new DataColumn(); 108 datacolum.ColumnName = "序号";
(IFeatureClass ftclass, string slayername)