Exemple #1
0
        public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
        {
            ImagePropertyDescriptor descriptor = (ImagePropertyDescriptor)context.PropertyDescriptor;
            string stringValue = ImagePropertyDescriptor.GetStringValue(descriptor.ImageProperty.Value, false);

            ShowValueDialog.Show(descriptor.DisplayName, descriptor.Description, stringValue);
            return(value);            //no edits allowed
        }
Exemple #2
0
            public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
            {
                var imageProperties = value as ImageProperties;

                if (destinationType == typeof(string) && imageProperties != null)
                {
                    return(ImagePropertyDescriptor.GetStringValue(CollectionUtils.Map <ImagePropertyDescriptor, IImageProperty>(imageProperties.GetProperties(), p => p.ImageProperty), true));
                }
                return(base.ConvertTo(context, culture, value, destinationType));
            }