AjaxControlToolkit.ServicePathConverter.ConvertTo C# (CSharp) Method

ConvertTo() public method

public ConvertTo ( ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType ) : object
context ITypeDescriptorContext
culture CultureInfo
value object
destinationType System.Type
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);
        }
ServicePathConverter