44 lines
1.1 KiB
C#
44 lines
1.1 KiB
C#
using System;
|
|||
|
|
using System.Windows;
|
||
|
|
|
||
|
|
namespace StandardScene.Fass2Simulator
|
||
|
|
{
|
||
|
|
public partial class App : Application
|
||
|
|
{
|
||
|
|
protected override void OnStartup(StartupEventArgs e)
|
||
|
|
{
|
||
|
|
if (HasTestArg(e.Args))
|
||
|
|
{
|
||
|
|
var code = Fass2SimSelfTests.Run(e.Args);
|
||
|
|
Shutdown(code);
|
||
|
|
return;
|
||
|
|
}
|
||
|
|
|
||
|
|
base.OnStartup(e);
|
||
|
|
Exit += (_, __) => Fass2SimFileLogger.Shutdown();
|
||
|
|
var window = new MainWindow();
|
||
|
|
MainWindow = window;
|
||
|
|
window.Show();
|
||
|
|
}
|
||
|
|
|
||
|
|
private static bool HasTestArg(string[] args)
|
||
|
|
{
|
||
|
|
if (args == null)
|
||
|
|
{
|
||
|
|
return false;
|
||
|
|
}
|
||
|
|
|
||
|
|
foreach (var arg in args)
|
||
|
|
{
|
||
|
|
if (string.Equals(arg, "--motion-test", StringComparison.OrdinalIgnoreCase)
|
||
|
|
|| string.Equals(arg, "--action-test", StringComparison.OrdinalIgnoreCase))
|
||
|
|
{
|
||
|
|
return true;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
return false;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|