@@ -629,144 +629,26 @@ public async Task PreparePropertyDescriptorAsync()
629
629
private static Type LookForTypeByName ( string typeName )
630
630
{
631
631
// First search locally
632
- var result = System . Type . GetType ( typeName ) ;
633
-
634
- if ( result != null )
635
- {
636
- return result ;
637
- }
638
-
639
- // Search in Windows
640
- var proxyType = VerticalAlignment . Center ;
641
- var assembly = proxyType . GetType ( ) . GetTypeInfo ( ) . Assembly ;
642
-
643
- foreach ( var typeInfo in assembly . ExportedTypes )
644
- {
645
- if ( typeInfo . Name == typeName )
646
- {
647
- return typeInfo ;
648
- }
649
- }
650
-
651
- // Search in Microsoft.Toolkit.Uwp.UI.Controls.Core
652
- var controlsCoreProxyType = StackMode . Replace ;
653
- assembly = controlsCoreProxyType . GetType ( ) . GetTypeInfo ( ) . Assembly ;
654
-
655
- foreach ( var typeInfo in assembly . ExportedTypes )
656
- {
657
- if ( typeInfo . Name == typeName )
658
- {
659
- return typeInfo ;
660
- }
661
- }
662
-
663
- // TODO Reintroduce graph controls
664
- //// Search in Microsoft.Toolkit.Graph.Controls
665
- //var graphControlsProxyType = typeof(UserToPersonConverter);
666
- //assembly = graphControlsProxyType.GetTypeInfo().Assembly;
667
-
668
- //foreach (var typeInfo in assembly.ExportedTypes)
669
- //{
670
- // if (typeInfo.Name == typeName)
671
- // {
672
- // return typeInfo;
673
- // }
674
- //}
675
-
676
- // Search in Microsoft.Toolkit.Uwp.UI.Animations
677
- var animationsProxyType = EasingType . Default ;
678
- assembly = animationsProxyType . GetType ( ) . GetTypeInfo ( ) . Assembly ;
679
- foreach ( var typeInfo in assembly . ExportedTypes )
680
- {
681
- if ( typeInfo . Name == typeName )
682
- {
683
- return typeInfo ;
684
- }
685
- }
686
-
687
- // Search in Microsoft.Toolkit.Uwp.UI
688
- var uiProxyType = ImageBlendMode . Multiply ;
689
- assembly = uiProxyType . GetType ( ) . GetTypeInfo ( ) . Assembly ;
690
- foreach ( var typeInfo in assembly . ExportedTypes )
691
- {
692
- if ( typeInfo . Name == typeName )
693
- {
694
- return typeInfo ;
695
- }
696
- }
697
-
698
- // Search in Microsoft.Toolkit.Uwp.Input.GazeInteraction
699
- var gazeType = Interaction . Enabled ;
700
- assembly = gazeType . GetType ( ) . GetTypeInfo ( ) . Assembly ;
701
- foreach ( var typeInfo in assembly . ExportedTypes )
702
- {
703
- if ( typeInfo . Name == typeName )
704
- {
705
- return typeInfo ;
706
- }
707
- }
708
-
709
- // Search in Microsoft.Toolkit.Uwp.UI.Controls.DataGrid
710
- var dataGridProxyType = DataGridGridLinesVisibility . None ;
711
- assembly = dataGridProxyType . GetType ( ) . GetTypeInfo ( ) . Assembly ;
712
-
713
- foreach ( var typeInfo in assembly . ExportedTypes )
714
- {
715
- if ( typeInfo . Name == typeName )
716
- {
717
- return typeInfo ;
718
- }
719
- }
720
-
721
- // Search in Microsoft.Toolkit.Uwp.UI.Controls.Layout
722
- var controlsLayoutProxyType = GridSplitter . GridResizeDirection . Auto ;
723
- assembly = controlsLayoutProxyType . GetType ( ) . GetTypeInfo ( ) . Assembly ;
724
-
725
- foreach ( var typeInfo in assembly . ExportedTypes )
726
- {
727
- if ( typeInfo . Name == typeName )
728
- {
729
- return typeInfo ;
730
- }
731
- }
732
-
733
- // Search in Microsoft.Toolkit.Uwp.UI.Controls.Markdown
734
- var markdownTextBlockType = typeof ( MarkdownTextBlock ) ;
735
- assembly = markdownTextBlockType . GetTypeInfo ( ) . Assembly ;
736
-
737
- foreach ( var typeInfo in assembly . ExportedTypes )
738
- {
739
- if ( typeInfo . Name == typeName )
740
- {
741
- return typeInfo ;
742
- }
743
- }
744
-
745
- // Search in Microsoft.Toolkit.Uwp.UI.Controls.Media
746
- var controlsMediaProxyType = BitmapFileFormat . Bmp ;
747
- assembly = controlsMediaProxyType . GetType ( ) . GetTypeInfo ( ) . Assembly ;
748
-
749
- foreach ( var typeInfo in assembly . ExportedTypes )
750
- {
751
- if ( typeInfo . Name == typeName )
752
- {
753
- return typeInfo ;
754
- }
755
- }
756
-
757
- // Search in Microsoft.Toolkit.Uwp.UI.Controls.Primitivs
758
- var controlsPrimitivsProxyType = StretchChild . Last ;
759
- assembly = controlsPrimitivsProxyType . GetType ( ) . GetTypeInfo ( ) . Assembly ;
760
-
761
- foreach ( var typeInfo in assembly . ExportedTypes )
762
- {
763
- if ( typeInfo . Name == typeName )
764
- {
765
- return typeInfo ;
766
- }
767
- }
768
-
769
- return null ;
632
+ if ( System . Type . GetType ( typeName ) is Type systemType )
633
+ {
634
+ return systemType ;
635
+ }
636
+
637
+ return
638
+ VerticalAlignment . Center . GetType ( ) . Assembly . ExportedTypes // Windows
639
+ . Concat ( StackMode . Replace . GetType ( ) . Assembly . ExportedTypes ) // Microsoft.Toolkit.Uwp.UI.Controls.Core
640
+
641
+ // TODO Reintroduce graph controls
642
+ // .Concat(typeof(UserToPersonConverter).Assembly.ExportedTypes) // Search in Microsoft.Toolkit.Graph.Controls
643
+ . Concat ( EasingType . Default . GetType ( ) . Assembly . ExportedTypes ) // Microsoft.Toolkit.Uwp.UI.Animations
644
+ . Concat ( ImageBlendMode . Multiply . GetType ( ) . Assembly . ExportedTypes ) // Search in Microsoft.Toolkit.Uwp.UI
645
+ . Concat ( Interaction . Enabled . GetType ( ) . Assembly . ExportedTypes ) // Microsoft.Toolkit.Uwp.Input.GazeInteraction
646
+ . Concat ( DataGridGridLinesVisibility . None . GetType ( ) . Assembly . ExportedTypes ) // Microsoft.Toolkit.Uwp.UI.Controls.DataGrid
647
+ . Concat ( GridSplitter . GridResizeDirection . Auto . GetType ( ) . Assembly . ExportedTypes ) // Microsoft.Toolkit.Uwp.UI.Controls.Layout
648
+ . Concat ( typeof ( MarkdownTextBlock ) . Assembly . ExportedTypes ) // Microsoft.Toolkit.Uwp.UI.Controls.Markdown
649
+ . Concat ( BitmapFileFormat . Bmp . GetType ( ) . Assembly . ExportedTypes ) // Microsoft.Toolkit.Uwp.UI.Controls.Media
650
+ . Concat ( StretchChild . Last . GetType ( ) . Assembly . ExportedTypes ) // Microsoft.Toolkit.Uwp.UI.Controls.Primitivs
651
+ . FirstOrDefault ( t => t . Name == typeName ) ;
770
652
}
771
653
772
654
private static async Task < string > GetDocsSHA ( )
0 commit comments