private Type EsriFieldTypeToSystemType(IField field)
{
esriFieldType esriType = field.Type;
// Does this field have a domain?
cvDomain = field.Domain as ICodedValueDomain;
if ((null != cvDomain) && useCVDomain)
{
return typeof(string);
}
try
{
switch (esriType)
{
case esriFieldType.esriFieldTypeBlob:
//beyond scope of sample to deal with blob fields
return typeof(string);
case esriFieldType.esriFieldTypeDate:
return typeof(DateTime);
case esriFieldType.esriFieldTypeDouble:
return typeof(double);
case esriFieldType.esriFieldTypeGeometry:
return typeof(string);
case esriFieldType.esriFieldTypeGlobalID:
return typeof(string);
case esriFieldType.esriFieldTypeGUID:
return typeof(Guid);
case esriFieldType.esriFieldTypeInteger:
return typeof(Int32);
case esriFieldType.esriFieldTypeOID:
return typeof(Int32);
case esriFieldType.esriFieldTypeRaster:
//beyond scope of sample to correctly display rasters
return typeof(string);
case esriFieldType.esriFieldTypeSingle:
return typeof(Single);
case esriFieldType.esriFieldTypeSmallInteger:
return typeof(Int16);
case esriFieldType.esriFieldTypeString:
return typeof(string);
default:
return typeof(string);
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine(ex.Message);
return typeof(string);
}
}