public override object ConvertFrom(ITypeDescriptorContext context,
                                           CultureInfo culture, object valueObject)
        {
            if (!(valueObject is string value))
            {
                throw new InvalidOperationException($"Cannot convert from type {valueObject.GetType()}");
            }

            IPathGeometry pathGeometry = PathConverter.ParsePathGeometry(value, GeometryFactory.Instance);

            return(pathGeometry);
        }
        public override object ConvertFromInvariantString(string value)
        {
            IPathGeometry pathGeometry = PathConverter.ParsePathGeometry(value, GeometryFactory.Instance);

            return(pathGeometry);
        }
Beispiel #3
0
 public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object valueObject)
 {
     return(PathConverter.ParsePathGeometry(GetValueAsString(valueObject), GeometryFactory.Instance));
 }