Skip to content

Commit ba5f7ff

Browse files
committed
Make execution more "lazy"
Should run more like the for loop version. Loads types from one assembly at a time.
1 parent 99faaf3 commit ba5f7ff

File tree

1 file changed

+17
-13
lines changed
  • Microsoft.Toolkit.Uwp.SampleApp/Models

1 file changed

+17
-13
lines changed

Microsoft.Toolkit.Uwp.SampleApp/Models/Sample.cs

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -634,21 +634,25 @@ private static Type LookForTypeByName(string typeName)
634634
return systemType;
635635
}
636636

637-
return
638-
VerticalAlignment.Center.GetType().Assembly.ExportedTypes // Windows
639-
.Concat(StackMode.Replace.GetType().Assembly.ExportedTypes) // Microsoft.Toolkit.Uwp.UI.Controls.Core
637+
var targets = new Type[]
638+
{
639+
VerticalAlignment.Center.GetType(), // Windows
640+
StackMode.Replace.GetType(), // Microsoft.Toolkit.Uwp.UI.Controls.Core
640641

641642
// 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);
643+
// typeof(UserToPersonConverter)) // Search in Microsoft.Toolkit.Graph.Controls
644+
EasingType.Default.GetType(), // Microsoft.Toolkit.Uwp.UI.Animations
645+
ImageBlendMode.Multiply.GetType(), // Search in Microsoft.Toolkit.Uwp.UI
646+
Interaction.Enabled.GetType(), // Microsoft.Toolkit.Uwp.Input.GazeInteraction
647+
DataGridGridLinesVisibility.None.GetType(), // Microsoft.Toolkit.Uwp.UI.Controls.DataGrid
648+
GridSplitter.GridResizeDirection.Auto.GetType(), // Microsoft.Toolkit.Uwp.UI.Controls.Layout
649+
typeof(MarkdownTextBlock), // Microsoft.Toolkit.Uwp.UI.Controls.Markdown
650+
BitmapFileFormat.Bmp.GetType(), // Microsoft.Toolkit.Uwp.UI.Controls.Media
651+
StretchChild.Last.GetType() // Microsoft.Toolkit.Uwp.UI.Controls.Primitivs
652+
};
653+
654+
return targets.SelectMany(t => t.Assembly.ExportedTypes)
655+
.FirstOrDefault(t => t.Name == typeName);
652656
}
653657

654658
private static async Task<string> GetDocsSHA()

0 commit comments

Comments
 (0)