private void ExportToShapefile(IFeatureClass fc, IWorkspace outWorkspace)
{
IDataset inDataSet = fc as IDataset;
IFeatureClassName inFCName = inDataSet.FullName as IFeatureClassName;
IWorkspace inWorkspace = inDataSet.Workspace;
IDataset outDataSet = outWorkspace as IDataset;
IWorkspaceName outWorkspaceName = outDataSet.FullName as IWorkspaceName;
IFeatureClassName outFCName = new FeatureClassNameClass();
IDatasetName dataSetName = outFCName as IDatasetName;
dataSetName.WorkspaceName = outWorkspaceName;
dataSetName.Name = fc.AliasName.ToString();
IFieldChecker fieldChecker = new FieldCheckerClass();
fieldChecker.InputWorkspace = inWorkspace;
fieldChecker.ValidateWorkspace = outWorkspace;
IFields fields = fc.Fields;
IFields outFields = null;
IEnumFieldError enumFieldError = null;
fieldChecker.Validate(fields,out enumFieldError,out outFields);
IFeatureDataConverter featureDataConverter = new FeatureDataConverterClass();
featureData