CreateNewShapeFile(string fullName, esriShapeType shapeType, ref IFeatureClass featureClass)
{
int count = fullName.LastIndexOf(".");
count = fullName.LastIndexOf("//");
string folder = fullName.Substring(0, count + 1);
string name = fullName.Substring(count + 1, fullName.Length - count - 1);
IWorkspace ipws;
IWorkspaceFactory ipwsf = new ShapefileWorkspaceFactoryClass();
ipws = ipwsf.OpenFromFile(folder, 0);
IFeatureWorkspace ifeatws;
ifeatws = ipws as IFeatureWorkspace;
if (featureClass != null)
{
System.Windows.Forms.MessageBox.Show("退出");
throw new System.NotImplementedException();
}
//////////////声明必要的对象/////////////////////////////
IFields pFields = new FieldsClass();
IField pField = new FieldClass();
IFieldsEdit pFieldsEdit = pFields as IFieldsEdit;
IFieldEdit pFieldEdit = pField as IFieldEdit;
IGeometryDef ipGeodef = new GeometryDefClass();
IGeometryDefEdit ipGeodefEdit = ipGeodef as IGeometryDefEdit;
// IGeoDataset geoDataset = featureClass as IGeoDataset;
ISpatialReference ipSpatialRef;
IUnknownCoordinateSystem iunknowncoord = new UnknownCoordinateSystemClass();
ipSpatialRef = iunknowncoord;
////////////声明结束///////////////////////////////////////
ipGeodefEdit.GeometryType_2 = (esriGeometryType)shapeType;
ipSpatialRef.SetMDomain(-10000, 10000);
ipGeodefEdit.HasM_2 = true;
ipGeodefEdit.HasZ_2 = true;
ipGeodefEdit.SpatialReference_2 = ipSpatialRef;
pFieldEdit.Name_2 = "Shape";
pFieldEdit.Type_2 = esriFieldType.esriFieldTypeGeometry;
pFieldEdit.GeometryDef_2 = ipGeodef;
pFieldsEdit.AddField(pField);
///////////////////////////////////////////////////////////////////设置shape文件的基本属性
featureClass=ifeatws.CreateFeatureClass(name, pFields, null, null, esriFeatureType.esriFTSimple, "Shape", "");
throw new System.NotImplementedException();
}