public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value) { if (!string.IsNullOrEmpty((string)value)) { IDynamics365ViewsProvider provider = (IDynamics365ViewsProvider)context.Instance; List <Dynamics365View> views = provider.GetDynamics365Views(); Guid id = Guid.Parse(Regex.Match((string)value, CoreUtility.FieldMatchPattern).Groups[1].Value); return(views.FirstOrDefault(view => view.ID == id)); } return(null); }
public override StandardValuesCollection GetStandardValues(ITypeDescriptorContext context) { IDynamics365ViewsProvider provider = (IDynamics365ViewsProvider)context.Instance; return(new StandardValuesCollection(provider.GetDynamics365Views())); }