Log unhanded exceptions

This commit is contained in:
Stone_Red
2023-10-05 11:24:17 +02:00
parent 1fe7f64b23
commit 15a6d9d2c5
2 changed files with 9 additions and 13 deletions
+8 -1
View File
@@ -1,2 +1,9 @@
using StoneRed.LogicSimulator.Srls srls = new StoneRed.LogicSimulator.Srls();
using Myra.Utility;
using System;
using System.IO;
AppDomain.CurrentDomain.UnhandledException += (_, e) => File.WriteAllText(Path.Combine(PathUtils.ExecutingAssemblyDirectory, "error.txt"), e.ExceptionObject.ToString());
using StoneRed.LogicSimulator.Srls srls = new StoneRed.LogicSimulator.Srls();
srls.Run();
@@ -20,7 +20,7 @@ internal class TestLogicGate : LogicGate, Interfaces.IDrawable
{
get
{
Draw();
texture.SetData(colors);
return texture;
}
}
@@ -28,12 +28,6 @@ internal class TestLogicGate : LogicGate, Interfaces.IDrawable
protected internal override void Initialize()
{
texture = CreateTexture(3, 3);
texture.SetData(new Color[]
{
Color.Red, Color.Blue, Color.Red,
Color.Blue, Color.Red, Color.Blue,
Color.Red, Color.Blue, Color.Red
});
}
protected override void Execute()
@@ -43,11 +37,6 @@ internal class TestLogicGate : LogicGate, Interfaces.IDrawable
colors[i] = GetInputBit(i) == 1 ? Color.Red : Color.Gray;
}
}
private void Draw()
{
texture.SetData(colors);
}
}
#endif