@@ -17,46 +17,26 @@ public override bool CanConvertTo(ITypeDescriptorContext? context, Type? destina
1717 var strValue = value ? . ToString ( ) ;
1818 if ( strValue is not null )
1919 {
20- if ( strValue . Equals ( "Start" , StringComparison . OrdinalIgnoreCase ) || strValue . Equals ( "left" , StringComparison . OrdinalIgnoreCase ) )
20+ if ( strValue . Equals ( "Start" , StringComparison . OrdinalIgnoreCase ) ||
21+ strValue . Equals ( "left" , StringComparison . OrdinalIgnoreCase ) ||
22+ strValue . Equals ( "top" , StringComparison . OrdinalIgnoreCase ) )
2123 {
2224 return TextAlignment . Start ;
2325 }
2426
25- if ( strValue . Equals ( "top" , StringComparison . OrdinalIgnoreCase ) )
26- {
27- return TextAlignment . Start ;
28- }
29-
30- if ( strValue . Equals ( "right" , StringComparison . OrdinalIgnoreCase ) )
31- {
32- return TextAlignment . End ;
33- }
34-
35- if ( strValue . Equals ( "bottom" , StringComparison . OrdinalIgnoreCase ) )
36- {
37- return TextAlignment . End ;
38- }
39-
40- if ( strValue . Equals ( "center" , StringComparison . OrdinalIgnoreCase ) )
41- {
42- return TextAlignment . Center ;
43- }
44-
45- if ( strValue . Equals ( "middle" , StringComparison . OrdinalIgnoreCase ) )
27+ if ( strValue . Equals ( "Center" , StringComparison . OrdinalIgnoreCase ) ||
28+ strValue . Equals ( "middle" , StringComparison . OrdinalIgnoreCase ) )
4629 {
4730 return TextAlignment . Center ;
4831 }
4932
50- if ( strValue . Equals ( "End" , StringComparison . OrdinalIgnoreCase ) || strValue . Equals ( "right" , StringComparison . OrdinalIgnoreCase ) )
33+ if ( strValue . Equals ( "End" , StringComparison . OrdinalIgnoreCase ) ||
34+ strValue . Equals ( "right" , StringComparison . OrdinalIgnoreCase ) ||
35+ strValue . Equals ( "bottom" , StringComparison . OrdinalIgnoreCase ) )
5136 {
5237 return TextAlignment . End ;
5338 }
5439
55- if ( strValue . Equals ( "Center" , StringComparison . OrdinalIgnoreCase ) || strValue . Equals ( "center" , StringComparison . OrdinalIgnoreCase ) )
56- {
57- return TextAlignment . Center ;
58- }
59-
6040 if ( Enum . TryParse ( strValue , out TextAlignment direction ) )
6141 {
6242 return direction ;
0 commit comments