public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value)
        {
            if (!string.IsNullOrEmpty((string)value))
            {
                IDynamics365StatesProvider provider = (IDynamics365StatesProvider)context.Instance;
                List <Dynamics365State>    states   = provider.GetStates();
                int code = int.Parse(Regex.Match((string)value, CoreUtility.FieldMatchPattern).Groups[1].Value);
                return(states.FirstOrDefault(x => x.Code == code));
            }

            return(null);
        }
        public override StandardValuesCollection GetStandardValues(ITypeDescriptorContext context)
        {
            IDynamics365StatesProvider provider = (IDynamics365StatesProvider)context.Instance;

            return(new StandardValuesCollection(provider.GetStates()));
        }