Merge pull request #146 from hawkerm/win32-sample-improvements
Win32 sample improvements
このコミットが含まれているのは:
2ファイル変更
+32
-17
検索条件に一致するファイルはありません
@@ -148,6 +148,12 @@ internal unsafe static class Win32ApplicationRunner
|
||||
{
|
||||
Thread.Sleep(100);
|
||||
}
|
||||
|
||||
// Also listen to Escape and 'Q' to quit
|
||||
if (msg.message == Windows.WM_KEYUP && (msg.wParam == Windows.VK_ESCAPE || msg.wParam == 'Q'))
|
||||
{
|
||||
_ = Windows.DestroyWindow(hwnd);
|
||||
}
|
||||
}
|
||||
|
||||
tokenSource.Cancel();
|
||||
|
||||
@@ -35,28 +35,37 @@ class Program
|
||||
|
||||
static void Main()
|
||||
{
|
||||
Console.WriteLine("Available samples:");
|
||||
Console.WriteLine();
|
||||
|
||||
for (int i = 0; i < Samples.Length; i++)
|
||||
{
|
||||
Console.WriteLine($"{i}: {Samples[i].GetType().GenericTypeArguments[0].Name}");
|
||||
}
|
||||
|
||||
Console.WriteLine();
|
||||
|
||||
int index;
|
||||
|
||||
do
|
||||
{
|
||||
Console.Write("Enter the index of the sample to run: ");
|
||||
Console.Clear();
|
||||
Console.WriteLine("Available samples:");
|
||||
Console.WriteLine();
|
||||
|
||||
for (int i = 0; i < Samples.Length; i++)
|
||||
{
|
||||
Console.WriteLine($"{i}: {Samples[i].GetType().GenericTypeArguments[0].Name}");
|
||||
}
|
||||
|
||||
Console.WriteLine($"{Samples.Length}+: Exit (Use Escape, 'Q', or Alt + F4 to exit a sample once chosen)");
|
||||
Console.WriteLine();
|
||||
|
||||
do
|
||||
{
|
||||
Console.Write("Enter the index of the sample to run: ");
|
||||
}
|
||||
while (!int.TryParse(Console.ReadLine(), out index));
|
||||
|
||||
if (index >= 0 && index < Samples.Length)
|
||||
{
|
||||
Console.WriteLine();
|
||||
Console.WriteLine($"Starting {Samples[index].GetType().GenericTypeArguments[0].Name}...");
|
||||
|
||||
Win32ApplicationRunner.Run(Samples[index]);
|
||||
}
|
||||
}
|
||||
while (!int.TryParse(Console.ReadLine(), out index));
|
||||
|
||||
Console.WriteLine();
|
||||
Console.WriteLine($"Starting {Samples[index].GetType().GenericTypeArguments[0].Name}...");
|
||||
|
||||
Win32ApplicationRunner.Run(Samples[index]);
|
||||
while (index >= 0 && index < Samples.Length);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
新しいイシューから参照
ユーザーをブロックする