Menu for testing examples for Test.NetFX
This commit is contained in:
parent
bd525b9921
commit
bf82277a39
4 changed files with 141 additions and 4 deletions
|
|
@ -1,12 +1,38 @@
|
|||
using Test.Common;
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Windows.Forms;
|
||||
using Raylib;
|
||||
using static Raylib.Raylib;
|
||||
|
||||
namespace Test.NetFX
|
||||
{
|
||||
class Program
|
||||
{
|
||||
[STAThread]
|
||||
static void Main(string[] args)
|
||||
{
|
||||
Common.Test.Run();
|
||||
Console.WriteLine("Welcome to raylib-cs!");
|
||||
|
||||
var dir = Environment.CurrentDirectory + "../../../Examples";
|
||||
while (true)
|
||||
{
|
||||
var ofd = new OpenFileDialog
|
||||
{
|
||||
Filter = @"C#|*.cs",
|
||||
Title = @"Select raylib example",
|
||||
InitialDirectory = dir
|
||||
};
|
||||
|
||||
if (ofd.ShowDialog() != DialogResult.OK)
|
||||
return;
|
||||
|
||||
var test = Path.GetFileNameWithoutExtension(ofd.FileName);
|
||||
Console.WriteLine("Running example " + test + "...");
|
||||
|
||||
ChangeDirectory(Path.GetDirectoryName(ofd.FileName));
|
||||
Type.GetType(test)?.GetMethod("Main")?.Invoke(null, args);
|
||||
Console.WriteLine();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue