View Issue Details

IDProjectCategoryView StatusLast Update
0003091NoesisGUIC# SDKpublic2024-06-04 21:00
Reportervoula_d Assigned Tosfernandez  
PrioritynormalSeveritymajor 
Status resolvedResolutionfixed 
Product Version3.2.3 
Target Version3.2.4Fixed in Version3.2.4 
Summary0003091: Cannot convert a string to Noesis.Size using TypeConverter.
Description

I am trying to do the following:

TypeConverter converter = TypeDescriptor.GetConverter(typeof(Noesis.Size));
converter.ConvertFrom("100,100") ;
And the conversion fails with an error: TypeConverter cannot convert from System.String.
Also, converter.CanConvertFrom(typeof(string)) returns false;
The same behaviour applies when trying to convert a string to Noesis.Rect

PlatformAny

Activities

sfernandez

sfernandez

2024-02-15 13:44

manager   ~0009188

It looks like Size type and similar are not defining the TypeConverter attribute as expected.
We need to specify it the same way we did for other types like Brush:
https://github.com/Noesis/Managed/blob/master/Src/Noesis/Core/Src/Proxies/Brush.cs#L18
https://github.com/Noesis/Managed/blob/master/Src/Noesis/Core/Src/Core/TypeConverterHelper.cs#L8

Thanks for reporting this.

voula_d

voula_d

2024-02-15 13:47

reporter   ~0009189

I am finding that the same applies to Noesis.Point too. Thanks!

sfernandez

sfernandez

2024-02-15 18:37

manager   ~0009198

By the way, if this is needed only for Size, Point or Rect types, you can just use as a workaround the TryParse() method they expose.

voula_d

voula_d

2024-02-20 14:21

reporter   ~0009221

Yes, that's how I worked around the issue for now. Thanks.

Issue History

Date Modified Username Field Change
2024-02-14 15:34 voula_d New Issue
2024-02-14 15:38 voula_d Description Updated
2024-02-15 13:38 sfernandez Assigned To => sfernandez
2024-02-15 13:38 sfernandez Status new => assigned
2024-02-15 13:38 sfernandez Target Version => 3.2.4
2024-02-15 13:44 sfernandez Status assigned => feedback
2024-02-15 13:44 sfernandez Note Added: 0009188
2024-02-15 13:47 voula_d Note Added: 0009189
2024-02-15 13:47 voula_d Status feedback => assigned
2024-02-15 18:37 sfernandez Status assigned => feedback
2024-02-15 18:37 sfernandez Note Added: 0009198
2024-02-20 14:21 voula_d Note Added: 0009221
2024-02-20 14:21 voula_d Status feedback => assigned
2024-06-04 21:00 sfernandez Status assigned => resolved
2024-06-04 21:00 sfernandez Resolution open => fixed
2024-06-04 21:00 sfernandez Fixed in Version => 3.2.4