public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value) { string str = value as string; if (!string.IsNullOrEmpty(str) && !this.IsQualifiedName(str)) { return(XName.Get(str)); } return(XNameTypeConverterHelper.ConvertFrom(context, value) ?? base.ConvertFrom(context, culture, value)); }
public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value) { string stringValue = value as string; if (!string.IsNullOrEmpty(stringValue)) { if (!IsQualifiedName(stringValue)) { // We want the name to remain unqualified; we don't want XNameTypeConverter to add the default namespace return(XName.Get(stringValue)); } } return(XNameTypeConverterHelper.ConvertFrom(context, value) ?? base.ConvertFrom(context, culture, value)); }