Fix warnings and index bugs in ControlCatalog sample (#20590)
This commit is contained in:
@@ -45,7 +45,7 @@ namespace ControlCatalog.Desktop
|
|||||||
double GetScaling()
|
double GetScaling()
|
||||||
{
|
{
|
||||||
var idx = Array.IndexOf(args, "--scaling");
|
var idx = Array.IndexOf(args, "--scaling");
|
||||||
if (idx != 0 && args.Length > idx + 1 &&
|
if (idx >= 0 && args.Length > idx + 1 &&
|
||||||
double.TryParse(args[idx + 1], NumberStyles.Any, CultureInfo.InvariantCulture, out var scaling))
|
double.TryParse(args[idx + 1], NumberStyles.Any, CultureInfo.InvariantCulture, out var scaling))
|
||||||
return scaling;
|
return scaling;
|
||||||
return 1;
|
return 1;
|
||||||
@@ -114,7 +114,7 @@ namespace ControlCatalog.Desktop
|
|||||||
{
|
{
|
||||||
builder.With(new Win32PlatformOptions()
|
builder.With(new Win32PlatformOptions()
|
||||||
{
|
{
|
||||||
CompositionMode = new [] { Win32CompositionMode.LowLatencyDxgiSwapChain }
|
CompositionMode = [Win32CompositionMode.LowLatencyDxgiSwapChain]
|
||||||
});
|
});
|
||||||
return builder.StartWithClassicDesktopLifetime(args);
|
return builder.StartWithClassicDesktopLifetime(args);
|
||||||
}
|
}
|
||||||
@@ -151,14 +151,14 @@ namespace ControlCatalog.Desktop
|
|||||||
.WithDeveloperTools()
|
.WithDeveloperTools()
|
||||||
.AfterSetup(builder =>
|
.AfterSetup(builder =>
|
||||||
{
|
{
|
||||||
EmbedSample.Implementation = OperatingSystem.IsWindows() ? (INativeDemoControl)new EmbedSampleWin()
|
EmbedSample.Implementation = OperatingSystem.IsWindows() ? new EmbedSampleWin()
|
||||||
: OperatingSystem.IsMacOS() ? new EmbedSampleMac()
|
: OperatingSystem.IsMacOS() ? new EmbedSampleMac()
|
||||||
: OperatingSystem.IsLinux() ? new EmbedSampleGtk()
|
: OperatingSystem.IsLinux() ? new EmbedSampleGtk()
|
||||||
: null;
|
: null;
|
||||||
})
|
})
|
||||||
.LogToTrace();
|
.LogToTrace();
|
||||||
|
|
||||||
static void SilenceConsole()
|
private static void SilenceConsole()
|
||||||
{
|
{
|
||||||
new Thread(() =>
|
new Thread(() =>
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user