Пример #1
0
        public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value)
        {
            if (!string.IsNullOrEmpty((string)value))
            {
                IDynamics365TargetEntitiesProvider provider = (IDynamics365TargetEntitiesProvider)context.Instance;
                List <Dynamics365Entity>           entities = provider.GetTargetEntities();
                string logicalName = Regex.Match((string)value, CoreUtility.FieldMatchPattern).Groups[1].Value;
                return(entities.FirstOrDefault(entity => entity.LogicalName == logicalName));
            }

            return(null);
        }
Пример #2
0
        public override StandardValuesCollection GetStandardValues(ITypeDescriptorContext context)
        {
            IDynamics365TargetEntitiesProvider provider = (IDynamics365TargetEntitiesProvider)context.Instance;

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