public ConvertFrom ( ITypeDescriptorContext context, |
||
context | ITypeDescriptorContext | ${WP_core_CRSTypeConverter_method_ConvertFrom_param_context} |
culture | ${WP_core_CRSTypeConverter_method_ConvertFrom_param_culture} | |
value | object | ${WP_core_CRSTypeConverter_method_ConvertFrom_param_value} |
return | object |
public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value)
{
string str = value as string;
if (str != null)
{
int wkid = Convert.ToInt32(str,CultureInfo.InvariantCulture);
return new CoordinateReferenceSystem(wkid);
}
throw new NotSupportedException(ExceptionStrings.InvalidToCRS);
//TODO:资源 Cannot convert to CoordinateReferenceSystem
}