public ConvertTo ( ITypeDescriptorContext context, CultureInfo culture, object value, |
||
context | ITypeDescriptorContext | |
culture | CultureInfo | |
value | object | |
destinationType | ||
return | object |
public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
{
if (destinationType == typeof(string)) {
string strValue = (string)value;
if (string.IsNullOrEmpty(strValue)) {
HttpContext currentContext = HttpContext.Current;
if (currentContext != null) {
return currentContext.Request.FilePath;
}
}
}
return base.ConvertTo(context, culture, value, destinationType);
}