public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value) { if (value is string stringValue) { var matchingHosts = AvailableTypes.Where(x => x.FullName.EndsWithOrdinalIgnoreCase(stringValue)).ToList(); Assert.HasSingleItem(matchingHosts); return(CreateHost(matchingHosts.Single())); } return(base.ConvertFrom(context, culture, value)); }
//methods------------------------------------------------------------------------------------- void UpdateFilteredList() { FilteredTypes = AvailableTypes.Where(x => x.Name.ToLower().Contains((filterString ?? "").ToLower())).ToList(); }