summaryrefslogtreecommitdiff
path: root/writer
diff options
context:
space:
mode:
authora1xd <[email protected]>2020-12-02 06:20:43 -0500
committera1xd <[email protected]>2020-12-02 06:20:43 -0500
commita5f00995dd48c2a83937e3503257d1b9fba2096f (patch)
tree2c56aff0daf25cd3f7335106ec4671b0da846777 /writer
parentsupport win7 while cross-signing is still available (diff)
downloadrawaccel-a5f00995dd48c2a83937e3503257d1b9fba2096f.tar.xz
rawaccel-a5f00995dd48c2a83937e3503257d1b9fba2096f.zip
update writer - use messagebox instead of console
Diffstat (limited to 'writer')
-rw-r--r--writer/Program.cs24
-rw-r--r--writer/writer.csproj1
2 files changed, 16 insertions, 9 deletions
diff --git a/writer/Program.cs b/writer/Program.cs
index ec8706b..37e384c 100644
--- a/writer/Program.cs
+++ b/writer/Program.cs
@@ -1,15 +1,21 @@
-using Microsoft.CSharp.RuntimeBinder;
-using Newtonsoft.Json;
+using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using System;
using System.IO;
+using System.Windows.Forms;
namespace writer
{
class Program
{
+
+ static void Show(string msg)
+ {
+ MessageBox.Show(msg, "Raw Accel writer");
+ }
+
static void Send(JToken settingsToken)
{
var settings = settingsToken.ToObject<DriverSettings>();
@@ -21,7 +27,7 @@ namespace writer
return;
}
- Console.Write("Bad settings: \n\n{0}", errors);
+ Show($"Bad settings:\n\n{errors}");
}
static void Main(string[] args)
@@ -32,19 +38,19 @@ namespace writer
}
catch (VersionException e)
{
- Console.WriteLine(e.Message);
+ Show(e.Message);
return;
}
- if (args.Length != 1 || args[0].Equals("help"))
+ if (args.Length != 1)
{
- Console.WriteLine("USAGE: {0} <file>", System.AppDomain.CurrentDomain.FriendlyName);
+ Show($"Usage: {System.AppDomain.CurrentDomain.FriendlyName} <settings file path>");
return;
}
if (!File.Exists(args[0]))
{
- Console.WriteLine("Settings file not found at {0}", args[0]);
+ Show($"Settings file not found at {args[0]}");
return;
}
@@ -62,11 +68,11 @@ namespace writer
}
catch (JsonException e)
{
- Console.WriteLine("Settings invalid:\n{0}", e.Message);
+ Show($"Settings invalid:\n\n{e.Message}");
}
catch (Exception e)
{
- Console.WriteLine("Error: {0}", e);
+ Show($"Error:\n\n{e}");
}
}
}
diff --git a/writer/writer.csproj b/writer/writer.csproj
index a874b7f..1c4cca5 100644
--- a/writer/writer.csproj
+++ b/writer/writer.csproj
@@ -44,6 +44,7 @@
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
+ <Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />