diff --git a/Amazfit.sln b/Amazfit.sln
index c73ef76..7721e16 100644
--- a/Amazfit.sln
+++ b/Amazfit.sln
@@ -3,9 +3,9 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.27004.2009
MinimumVisualStudioVersion = 10.0.40219.1
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WatchFace", "WatchFace\WatchFace.csproj", "{8D2E0224-DE7F-4EC9-AD23-9904B9D7B409}"
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WatchFace.Parser", "WatchFace.Parser\WatchFace.Parser.csproj", "{8D2E0224-DE7F-4EC9-AD23-9904B9D7B409}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WatchFace.Cmd", "WatchFace.Cmd\WatchFace.Cmd.csproj", "{963BCF47-8C24-4219-BC84-8EC3670205B3}"
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WatchFace", "WatchFace\WatchFace.csproj", "{963BCF47-8C24-4219-BC84-8EC3670205B3}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
diff --git a/WatchFace.Cmd/Program.cs b/WatchFace.Cmd/Program.cs
deleted file mode 100644
index 1a461e0..0000000
--- a/WatchFace.Cmd/Program.cs
+++ /dev/null
@@ -1,85 +0,0 @@
-using System;
-using System.IO;
-using Newtonsoft.Json;
-using NLog;
-using NLog.Config;
-using NLog.Targets;
-using SixLabors.ImageSharp;
-using WatchFace;
-
-namespace Cmd
-{
- internal class Program
- {
- private static readonly Logger Logger = LogManager.GetCurrentClassLogger();
-
- private static int Main(string[] args)
- {
- var inputFileName = args[0];
- if (inputFileName == null)
- {
- Usage();
- return 1;
- }
-
- var useTrace = args.Length > 1 && args[1] == "--debug";
- SetupLogger(useTrace);
-
- Reader reader;
- Logger.Debug("Opening watch face '{0}'", inputFileName);
- using (var fileStream = File.OpenRead(inputFileName))
- {
- reader = new Reader(fileStream);
- Logger.Debug("Reading watch face parameters...");
- reader.Parse();
- }
-
- Logger.Debug("Parsing parameters...");
- var watchFace = WatchFace.WatchFace.Parse(reader.Resources);
-
- var path = Path.GetDirectoryName(inputFileName);
- var name = Path.GetFileNameWithoutExtension(inputFileName);
- var unpackedPath = Path.Combine(path, $"{name}_unpacked");
- if (!Directory.Exists(unpackedPath)) Directory.CreateDirectory(unpackedPath);
- Logger.Debug("Unpacking watch face to '{0}'", unpackedPath);
-
- var configFileName = Path.Combine(unpackedPath, "config.json");
- Logger.Debug("Eporting config...");
- using (var fileStream = File.OpenWrite(configFileName))
- using (var writer = new StreamWriter(fileStream))
- {
- writer.Write(JsonConvert.SerializeObject(watchFace, Formatting.Indented,
- new JsonSerializerSettings {NullValueHandling = NullValueHandling.Ignore}));
- writer.Flush();
- }
-
- Logger.Debug("Eporting images...");
- var index = 0;
- foreach (var image in reader.Images)
- {
- image.Save(Path.Combine(unpackedPath, $"{index}.bmp"));
- index++;
- }
-
- Logger.Debug("Everything done!");
- Console.ReadKey();
- return 0;
- }
-
- private static void SetupLogger(bool useTrace)
- {
- var config = new LoggingConfiguration();
- var consoleTarget = new ColoredConsoleTarget();
- config.AddTarget("console", consoleTarget);
- var rule1 = new LoggingRule("*", useTrace ? LogLevel.Trace : LogLevel.Debug, consoleTarget);
- config.LoggingRules.Add(rule1);
- LogManager.Configuration = config;
- }
-
- private static void Usage()
- {
- Console.WriteLine("Usage: wf.exe [watchface bin]");
- Console.WriteLine();
- }
- }
-}
\ No newline at end of file
diff --git a/WatchFace.Cmd/WatchFace.Cmd.csproj b/WatchFace.Cmd/WatchFace.Cmd.csproj
deleted file mode 100644
index c8db17e..0000000
--- a/WatchFace.Cmd/WatchFace.Cmd.csproj
+++ /dev/null
@@ -1,161 +0,0 @@
-
-
-
-
- Debug
- AnyCPU
- {963BCF47-8C24-4219-BC84-8EC3670205B3}
- Exe
- WatchFace.Cmd
- WatchFace.Cmd
- v4.6.1
- 512
- true
-
-
-
-
- AnyCPU
- true
- full
- false
- bin\Debug\
- DEBUG;TRACE
- prompt
- 4
-
-
- AnyCPU
- pdbonly
- true
- bin\Release\
- TRACE
- prompt
- 4
-
-
-
- ..\packages\Microsoft.Win32.Primitives.4.3.0\lib\net46\Microsoft.Win32.Primitives.dll
- True
-
-
- ..\packages\Newtonsoft.Json.10.0.3\lib\net45\Newtonsoft.Json.dll
-
-
- ..\packages\NLog.4.4.12\lib\net45\NLog.dll
-
-
- ..\packages\SixLabors.Core.1.0.0-beta0004\lib\netstandard1.1\SixLabors.Core.dll
-
-
- ..\packages\SixLabors.ImageSharp.1.0.0-beta0002\lib\netstandard2.0\SixLabors.ImageSharp.dll
-
-
-
- ..\packages\System.AppContext.4.3.0\lib\net46\System.AppContext.dll
- True
-
-
- ..\packages\System.Buffers.4.4.0\lib\netstandard2.0\System.Buffers.dll
-
-
-
- ..\packages\System.Console.4.3.0\lib\net46\System.Console.dll
- True
-
-
-
- ..\packages\System.Diagnostics.DiagnosticSource.4.4.1\lib\net46\System.Diagnostics.DiagnosticSource.dll
-
-
- ..\packages\System.Globalization.Calendars.4.3.0\lib\net46\System.Globalization.Calendars.dll
- True
-
-
- ..\packages\System.IO.Compression.4.3.0\lib\net46\System.IO.Compression.dll
- True
-
-
-
- ..\packages\System.IO.Compression.ZipFile.4.3.0\lib\net46\System.IO.Compression.ZipFile.dll
- True
-
-
- ..\packages\System.IO.FileSystem.4.3.0\lib\net46\System.IO.FileSystem.dll
- True
-
-
- ..\packages\System.IO.FileSystem.Primitives.4.3.0\lib\net46\System.IO.FileSystem.Primitives.dll
- True
-
-
- ..\packages\System.Memory.4.4.0-preview2-25405-01\lib\netstandard2.0\System.Memory.dll
-
-
- ..\packages\System.Net.Http.4.3.0\lib\net46\System.Net.Http.dll
- True
-
-
- ..\packages\System.Net.Sockets.4.3.0\lib\net46\System.Net.Sockets.dll
- True
-
-
-
- ..\packages\System.Numerics.Vectors.4.4.0\lib\net46\System.Numerics.Vectors.dll
-
-
- ..\packages\System.Runtime.CompilerServices.Unsafe.4.4.0\lib\netstandard2.0\System.Runtime.CompilerServices.Unsafe.dll
-
-
- ..\packages\System.Runtime.InteropServices.RuntimeInformation.4.3.0\lib\net45\System.Runtime.InteropServices.RuntimeInformation.dll
- True
-
-
- ..\packages\System.Security.Cryptography.Algorithms.4.3.0\lib\net461\System.Security.Cryptography.Algorithms.dll
- True
-
-
- ..\packages\System.Security.Cryptography.Encoding.4.3.0\lib\net46\System.Security.Cryptography.Encoding.dll
- True
-
-
- ..\packages\System.Security.Cryptography.Primitives.4.3.0\lib\net46\System.Security.Cryptography.Primitives.dll
- True
-
-
- ..\packages\System.Security.Cryptography.X509Certificates.4.3.2\lib\net461\System.Security.Cryptography.X509Certificates.dll
- True
-
-
-
-
-
-
-
- ..\packages\System.Xml.ReaderWriter.4.3.0\lib\net46\System.Xml.ReaderWriter.dll
- True
-
-
-
-
-
-
-
-
-
-
-
-
- {8d2e0224-de7f-4ec9-ad23-9904b9d7b409}
- WatchFace
-
-
-
-
-
-
- This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.
-
-
-
-
\ No newline at end of file
diff --git a/WatchFace/Elements/Activity.cs b/WatchFace.Parser/Elements/Activity.cs
similarity index 100%
rename from WatchFace/Elements/Activity.cs
rename to WatchFace.Parser/Elements/Activity.cs
diff --git a/WatchFace/Elements/ActivityElements/FormattedNumber.cs b/WatchFace.Parser/Elements/ActivityElements/FormattedNumber.cs
similarity index 100%
rename from WatchFace/Elements/ActivityElements/FormattedNumber.cs
rename to WatchFace.Parser/Elements/ActivityElements/FormattedNumber.cs
diff --git a/WatchFace/Elements/AnalogDialFace.cs b/WatchFace.Parser/Elements/AnalogDialFace.cs
similarity index 100%
rename from WatchFace/Elements/AnalogDialFace.cs
rename to WatchFace.Parser/Elements/AnalogDialFace.cs
diff --git a/WatchFace/Elements/Background.cs b/WatchFace.Parser/Elements/Background.cs
similarity index 100%
rename from WatchFace/Elements/Background.cs
rename to WatchFace.Parser/Elements/Background.cs
diff --git a/WatchFace/Elements/BasicElements/CircleScale.cs b/WatchFace.Parser/Elements/BasicElements/CircleScale.cs
similarity index 100%
rename from WatchFace/Elements/BasicElements/CircleScale.cs
rename to WatchFace.Parser/Elements/BasicElements/CircleScale.cs
diff --git a/WatchFace/Elements/BasicElements/ClockHand.cs b/WatchFace.Parser/Elements/BasicElements/ClockHand.cs
similarity index 100%
rename from WatchFace/Elements/BasicElements/ClockHand.cs
rename to WatchFace.Parser/Elements/BasicElements/ClockHand.cs
diff --git a/WatchFace/Elements/BasicElements/Coordinates.cs b/WatchFace.Parser/Elements/BasicElements/Coordinates.cs
similarity index 100%
rename from WatchFace/Elements/BasicElements/Coordinates.cs
rename to WatchFace.Parser/Elements/BasicElements/Coordinates.cs
diff --git a/WatchFace/Elements/BasicElements/Image.cs b/WatchFace.Parser/Elements/BasicElements/Image.cs
similarity index 100%
rename from WatchFace/Elements/BasicElements/Image.cs
rename to WatchFace.Parser/Elements/BasicElements/Image.cs
diff --git a/WatchFace/Elements/BasicElements/ImageSet.cs b/WatchFace.Parser/Elements/BasicElements/ImageSet.cs
similarity index 100%
rename from WatchFace/Elements/BasicElements/ImageSet.cs
rename to WatchFace.Parser/Elements/BasicElements/ImageSet.cs
diff --git a/WatchFace/Elements/BasicElements/Number.cs b/WatchFace.Parser/Elements/BasicElements/Number.cs
similarity index 100%
rename from WatchFace/Elements/BasicElements/Number.cs
rename to WatchFace.Parser/Elements/BasicElements/Number.cs
diff --git a/WatchFace/Elements/BasicElements/Scale.cs b/WatchFace.Parser/Elements/BasicElements/Scale.cs
similarity index 100%
rename from WatchFace/Elements/BasicElements/Scale.cs
rename to WatchFace.Parser/Elements/BasicElements/Scale.cs
diff --git a/WatchFace/Elements/BasicElements/TwoDigits.cs b/WatchFace.Parser/Elements/BasicElements/TwoDigits.cs
similarity index 100%
rename from WatchFace/Elements/BasicElements/TwoDigits.cs
rename to WatchFace.Parser/Elements/BasicElements/TwoDigits.cs
diff --git a/WatchFace/Elements/Battery.cs b/WatchFace.Parser/Elements/Battery.cs
similarity index 100%
rename from WatchFace/Elements/Battery.cs
rename to WatchFace.Parser/Elements/Battery.cs
diff --git a/WatchFace/Elements/Date.cs b/WatchFace.Parser/Elements/Date.cs
similarity index 100%
rename from WatchFace/Elements/Date.cs
rename to WatchFace.Parser/Elements/Date.cs
diff --git a/WatchFace/Elements/DateElements/MonthAndDay.cs b/WatchFace.Parser/Elements/DateElements/MonthAndDay.cs
similarity index 100%
rename from WatchFace/Elements/DateElements/MonthAndDay.cs
rename to WatchFace.Parser/Elements/DateElements/MonthAndDay.cs
diff --git a/WatchFace/Elements/DateElements/OneLineMonthAndDay.cs b/WatchFace.Parser/Elements/DateElements/OneLineMonthAndDay.cs
similarity index 100%
rename from WatchFace/Elements/DateElements/OneLineMonthAndDay.cs
rename to WatchFace.Parser/Elements/DateElements/OneLineMonthAndDay.cs
diff --git a/WatchFace/Elements/DateElements/SeparateMonthAndDay.cs b/WatchFace.Parser/Elements/DateElements/SeparateMonthAndDay.cs
similarity index 100%
rename from WatchFace/Elements/DateElements/SeparateMonthAndDay.cs
rename to WatchFace.Parser/Elements/DateElements/SeparateMonthAndDay.cs
diff --git a/WatchFace/Elements/Scales.cs b/WatchFace.Parser/Elements/Scales.cs
similarity index 100%
rename from WatchFace/Elements/Scales.cs
rename to WatchFace.Parser/Elements/Scales.cs
diff --git a/WatchFace/Elements/Status.cs b/WatchFace.Parser/Elements/Status.cs
similarity index 100%
rename from WatchFace/Elements/Status.cs
rename to WatchFace.Parser/Elements/Status.cs
diff --git a/WatchFace/Elements/StatusElements/Flag.cs b/WatchFace.Parser/Elements/StatusElements/Flag.cs
similarity index 100%
rename from WatchFace/Elements/StatusElements/Flag.cs
rename to WatchFace.Parser/Elements/StatusElements/Flag.cs
diff --git a/WatchFace/Elements/StatusElements/Switch.cs b/WatchFace.Parser/Elements/StatusElements/Switch.cs
similarity index 100%
rename from WatchFace/Elements/StatusElements/Switch.cs
rename to WatchFace.Parser/Elements/StatusElements/Switch.cs
diff --git a/WatchFace/Elements/Time.cs b/WatchFace.Parser/Elements/Time.cs
similarity index 100%
rename from WatchFace/Elements/Time.cs
rename to WatchFace.Parser/Elements/Time.cs
diff --git a/WatchFace/Elements/TimeElements/AmPm.cs b/WatchFace.Parser/Elements/TimeElements/AmPm.cs
similarity index 100%
rename from WatchFace/Elements/TimeElements/AmPm.cs
rename to WatchFace.Parser/Elements/TimeElements/AmPm.cs
diff --git a/WatchFace/Elements/Weather.cs b/WatchFace.Parser/Elements/Weather.cs
similarity index 100%
rename from WatchFace/Elements/Weather.cs
rename to WatchFace.Parser/Elements/Weather.cs
diff --git a/WatchFace/Elements/WeatherElements/AirPollution.cs b/WatchFace.Parser/Elements/WeatherElements/AirPollution.cs
similarity index 100%
rename from WatchFace/Elements/WeatherElements/AirPollution.cs
rename to WatchFace.Parser/Elements/WeatherElements/AirPollution.cs
diff --git a/WatchFace/Elements/WeatherElements/OneLineTemperature.cs b/WatchFace.Parser/Elements/WeatherElements/OneLineTemperature.cs
similarity index 100%
rename from WatchFace/Elements/WeatherElements/OneLineTemperature.cs
rename to WatchFace.Parser/Elements/WeatherElements/OneLineTemperature.cs
diff --git a/WatchFace/Elements/WeatherElements/SeparateTemperature.cs b/WatchFace.Parser/Elements/WeatherElements/SeparateTemperature.cs
similarity index 100%
rename from WatchFace/Elements/WeatherElements/SeparateTemperature.cs
rename to WatchFace.Parser/Elements/WeatherElements/SeparateTemperature.cs
diff --git a/WatchFace/Elements/WeatherElements/Temperature.cs b/WatchFace.Parser/Elements/WeatherElements/Temperature.cs
similarity index 100%
rename from WatchFace/Elements/WeatherElements/Temperature.cs
rename to WatchFace.Parser/Elements/WeatherElements/Temperature.cs
diff --git a/WatchFace/Elements/WeatherElements/TemperatureNumber.cs b/WatchFace.Parser/Elements/WeatherElements/TemperatureNumber.cs
similarity index 100%
rename from WatchFace/Elements/WeatherElements/TemperatureNumber.cs
rename to WatchFace.Parser/Elements/WeatherElements/TemperatureNumber.cs
diff --git a/WatchFace/Elements/WeatherElements/TodayTemperature.cs b/WatchFace.Parser/Elements/WeatherElements/TodayTemperature.cs
similarity index 100%
rename from WatchFace/Elements/WeatherElements/TodayTemperature.cs
rename to WatchFace.Parser/Elements/WeatherElements/TodayTemperature.cs
diff --git a/WatchFace/Elements/WeatherElements/WeatherIcon.cs b/WatchFace.Parser/Elements/WeatherElements/WeatherIcon.cs
similarity index 100%
rename from WatchFace/Elements/WeatherElements/WeatherIcon.cs
rename to WatchFace.Parser/Elements/WeatherElements/WeatherIcon.cs
diff --git a/WatchFace/Image.cs b/WatchFace.Parser/Image.cs
similarity index 100%
rename from WatchFace/Image.cs
rename to WatchFace.Parser/Image.cs
diff --git a/WatchFace/InvalidParameterException.cs b/WatchFace.Parser/InvalidParameterException.cs
similarity index 100%
rename from WatchFace/InvalidParameterException.cs
rename to WatchFace.Parser/InvalidParameterException.cs
diff --git a/WatchFace/JsonConverters/HexStringJsonConverter.cs b/WatchFace.Parser/JsonConverters/HexStringJsonConverter.cs
similarity index 100%
rename from WatchFace/JsonConverters/HexStringJsonConverter.cs
rename to WatchFace.Parser/JsonConverters/HexStringJsonConverter.cs
diff --git a/WatchFace/Models/Header.cs b/WatchFace.Parser/Models/Header.cs
similarity index 100%
rename from WatchFace/Models/Header.cs
rename to WatchFace.Parser/Models/Header.cs
diff --git a/WatchFace/Models/Parameter.cs b/WatchFace.Parser/Models/Parameter.cs
similarity index 100%
rename from WatchFace/Models/Parameter.cs
rename to WatchFace.Parser/Models/Parameter.cs
diff --git a/WatchFace/Models/ParameterFlags.cs b/WatchFace.Parser/Models/ParameterFlags.cs
similarity index 100%
rename from WatchFace/Models/ParameterFlags.cs
rename to WatchFace.Parser/Models/ParameterFlags.cs
diff --git a/WatchFace/Reader.cs b/WatchFace.Parser/Reader.cs
similarity index 99%
rename from WatchFace/Reader.cs
rename to WatchFace.Parser/Reader.cs
index b878cbc..e68f906 100644
--- a/WatchFace/Reader.cs
+++ b/WatchFace.Parser/Reader.cs
@@ -21,7 +21,7 @@ namespace WatchFace
public List Resources { get; private set; }
public List> Images { get; private set; }
- public void Parse()
+ public void Read()
{
Logger.Trace("Reading header...");
var header = Header.ReadFrom(_fileStream);
diff --git a/WatchFace/Utils/BitReader.cs b/WatchFace.Parser/Utils/BitReader.cs
similarity index 100%
rename from WatchFace/Utils/BitReader.cs
rename to WatchFace.Parser/Utils/BitReader.cs
diff --git a/WatchFace.Parser/WatchFace.Parser.csproj b/WatchFace.Parser/WatchFace.Parser.csproj
new file mode 100644
index 0000000..9de5f00
--- /dev/null
+++ b/WatchFace.Parser/WatchFace.Parser.csproj
@@ -0,0 +1,20 @@
+
+
+
+ netstandard2.0
+ WatchFace
+
+
+
+
+
+
+
+
+
+
+ ..\..\..\..\.nuget\packages\newtonsoft.json\10.0.3\lib\netstandard1.3\Newtonsoft.Json.dll
+
+
+
+
diff --git a/WatchFace/WatchFace.cs b/WatchFace.Parser/WatchFace.cs
similarity index 100%
rename from WatchFace/WatchFace.cs
rename to WatchFace.Parser/WatchFace.cs
diff --git a/WatchFace.Cmd/App.config b/WatchFace/App.config
similarity index 100%
rename from WatchFace.Cmd/App.config
rename to WatchFace/App.config
diff --git a/WatchFace/Program.cs b/WatchFace/Program.cs
new file mode 100644
index 0000000..5afc2f6
--- /dev/null
+++ b/WatchFace/Program.cs
@@ -0,0 +1,133 @@
+using System;
+using System.IO;
+using Newtonsoft.Json;
+using NLog;
+using NLog.Config;
+using NLog.Targets;
+using SixLabors.ImageSharp;
+
+namespace WatchFace.Cmd
+{
+ internal class Program
+ {
+ private const string AppName = "WatchFace";
+
+ private static readonly Logger Logger = LogManager.GetCurrentClassLogger();
+
+ private static void Main(string[] args)
+ {
+ var inputFileName = args[0];
+ if (inputFileName == null)
+ {
+ Console.WriteLine("{0} unpacks Amazfit Bip downloadable watch faces.", AppName);
+ Console.WriteLine("Usage: {0}.exe watchface.bin", AppName);
+ return;
+ }
+
+ SetupLogger(LogLevel.Trace);
+
+ var reader = ReadWatchFace(inputFileName);
+ if (reader == null) return;
+
+ var watchFace = ParseResources(reader);
+ if (watchFace == null) return;
+
+ var outputDirectory = CreateOutputDirectory(inputFileName);
+
+ Logger.Debug("Exporting resources to '{0}'", outputDirectory);
+ ExportImages(reader, outputDirectory);
+ ExportConfig(watchFace, outputDirectory);
+ }
+
+ private static Reader ReadWatchFace(string inputFileName)
+ {
+ Logger.Debug("Opening watch face '{0}'", inputFileName);
+ try
+ {
+ using (var fileStream = File.OpenRead(inputFileName))
+ {
+ var reader = new Reader(fileStream);
+ Logger.Debug("Reading parameters...");
+ reader.Read();
+ return reader;
+ }
+ }
+ catch (Exception e)
+ {
+ Logger.Fatal(e);
+ return null;
+ }
+ }
+
+ private static WatchFace ParseResources(Reader reader)
+ {
+ Logger.Debug("Parsing parameters...");
+ try
+ {
+ return WatchFace.Parse(reader.Resources);
+ }
+ catch (Exception e)
+ {
+ Logger.Fatal(e);
+ return null;
+ }
+ }
+
+ private static string CreateOutputDirectory(string originalFileName)
+ {
+ var path = Path.GetDirectoryName(originalFileName);
+ var name = Path.GetFileNameWithoutExtension(originalFileName);
+ var unpackedPath = Path.Combine(path, $"{name}_unpacked");
+ if (!Directory.Exists(unpackedPath)) Directory.CreateDirectory(unpackedPath);
+ return unpackedPath;
+ }
+
+ private static void ExportImages(Reader reader, string outputDirectory)
+ {
+ Logger.Debug("Exporting images...");
+ try
+ {
+ var index = 0;
+ foreach (var image in reader.Images)
+ {
+ image.Save(Path.Combine(outputDirectory, $"{index}.bmp"));
+ index++;
+ }
+ }
+ catch (Exception e)
+ {
+ Logger.Fatal(e);
+ }
+ }
+
+ private static void ExportConfig(WatchFace watchFace, string outputDirectory)
+ {
+ var configFileName = Path.Combine(outputDirectory, "config.json");
+ Logger.Debug("Exporting config...");
+ try
+ {
+ using (var fileStream = File.OpenWrite(configFileName))
+ using (var writer = new StreamWriter(fileStream))
+ {
+ writer.Write(JsonConvert.SerializeObject(watchFace, Formatting.Indented,
+ new JsonSerializerSettings {NullValueHandling = NullValueHandling.Ignore}));
+ writer.Flush();
+ }
+ }
+ catch (Exception e)
+ {
+ Logger.Fatal(e);
+ }
+ }
+
+ private static void SetupLogger(LogLevel logLevel)
+ {
+ var config = new LoggingConfiguration();
+ var consoleTarget = new ColoredConsoleTarget();
+ config.AddTarget("console", consoleTarget);
+ var rule1 = new LoggingRule("*", logLevel, consoleTarget);
+ config.LoggingRules.Add(rule1);
+ LogManager.Configuration = config;
+ }
+ }
+}
\ No newline at end of file
diff --git a/WatchFace.Cmd/Properties/AssemblyInfo.cs b/WatchFace/Properties/AssemblyInfo.cs
similarity index 100%
rename from WatchFace.Cmd/Properties/AssemblyInfo.cs
rename to WatchFace/Properties/AssemblyInfo.cs
diff --git a/WatchFace/WatchFace.csproj b/WatchFace/WatchFace.csproj
index 1f0c8a3..df964bb 100644
--- a/WatchFace/WatchFace.csproj
+++ b/WatchFace/WatchFace.csproj
@@ -1,19 +1,161 @@
-
-
+
+
+
- netstandard2.0
+ Debug
+ AnyCPU
+ {963BCF47-8C24-4219-BC84-8EC3670205B3}
+ Exe
+ WatchFace.Cmd
+ WatchFace.Cmd
+ v4.6.1
+ 512
+ true
+
+
+
+
+ AnyCPU
+ true
+ full
+ false
+ bin\Debug\
+ DEBUG;TRACE
+ prompt
+ 4
+
+
+ AnyCPU
+ pdbonly
+ true
+ bin\Release\
+ TRACE
+ prompt
+ 4
-
-
-
-
-
-
-
-
- ..\..\..\..\.nuget\packages\newtonsoft.json\10.0.3\lib\netstandard1.3\Newtonsoft.Json.dll
+
+ ..\packages\Microsoft.Win32.Primitives.4.3.0\lib\net46\Microsoft.Win32.Primitives.dll
+ True
+
+
+ ..\packages\Newtonsoft.Json.10.0.3\lib\net45\Newtonsoft.Json.dll
+
+
+ ..\packages\NLog.4.4.12\lib\net45\NLog.dll
+
+
+ ..\packages\SixLabors.Core.1.0.0-beta0004\lib\netstandard1.1\SixLabors.Core.dll
+
+
+ ..\packages\SixLabors.ImageSharp.1.0.0-beta0002\lib\netstandard2.0\SixLabors.ImageSharp.dll
+
+
+
+ ..\packages\System.AppContext.4.3.0\lib\net46\System.AppContext.dll
+ True
+
+
+ ..\packages\System.Buffers.4.4.0\lib\netstandard2.0\System.Buffers.dll
+
+
+
+ ..\packages\System.Console.4.3.0\lib\net46\System.Console.dll
+ True
+
+
+
+ ..\packages\System.Diagnostics.DiagnosticSource.4.4.1\lib\net46\System.Diagnostics.DiagnosticSource.dll
+
+
+ ..\packages\System.Globalization.Calendars.4.3.0\lib\net46\System.Globalization.Calendars.dll
+ True
+
+
+ ..\packages\System.IO.Compression.4.3.0\lib\net46\System.IO.Compression.dll
+ True
+
+
+
+ ..\packages\System.IO.Compression.ZipFile.4.3.0\lib\net46\System.IO.Compression.ZipFile.dll
+ True
+
+
+ ..\packages\System.IO.FileSystem.4.3.0\lib\net46\System.IO.FileSystem.dll
+ True
+
+
+ ..\packages\System.IO.FileSystem.Primitives.4.3.0\lib\net46\System.IO.FileSystem.Primitives.dll
+ True
+
+
+ ..\packages\System.Memory.4.4.0-preview2-25405-01\lib\netstandard2.0\System.Memory.dll
+
+
+ ..\packages\System.Net.Http.4.3.0\lib\net46\System.Net.Http.dll
+ True
+
+
+ ..\packages\System.Net.Sockets.4.3.0\lib\net46\System.Net.Sockets.dll
+ True
+
+
+
+ ..\packages\System.Numerics.Vectors.4.4.0\lib\net46\System.Numerics.Vectors.dll
+
+
+ ..\packages\System.Runtime.CompilerServices.Unsafe.4.4.0\lib\netstandard2.0\System.Runtime.CompilerServices.Unsafe.dll
+
+
+ ..\packages\System.Runtime.InteropServices.RuntimeInformation.4.3.0\lib\net45\System.Runtime.InteropServices.RuntimeInformation.dll
+ True
+
+
+ ..\packages\System.Security.Cryptography.Algorithms.4.3.1\lib\net461\System.Security.Cryptography.Algorithms.dll
+ True
+
+
+ ..\packages\System.Security.Cryptography.Encoding.4.3.0\lib\net46\System.Security.Cryptography.Encoding.dll
+ True
+
+
+ ..\packages\System.Security.Cryptography.Primitives.4.3.0\lib\net46\System.Security.Cryptography.Primitives.dll
+ True
+
+
+ ..\packages\System.Security.Cryptography.X509Certificates.4.3.2\lib\net461\System.Security.Cryptography.X509Certificates.dll
+ True
+
+
+
+
+
+
+
+ ..\packages\System.Xml.ReaderWriter.4.3.0\lib\net46\System.Xml.ReaderWriter.dll
+ True
-
-
+
+
+
+
+
+
+
+
+
+
+ {8d2e0224-de7f-4ec9-ad23-9904b9d7b409}
+ WatchFace.Parser
+
+
+
+
+
+
+ This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.
+
+
+
+
\ No newline at end of file
diff --git a/WatchFace.Cmd/packages.config b/WatchFace/packages.config
similarity index 98%
rename from WatchFace.Cmd/packages.config
rename to WatchFace/packages.config
index 4fe1829..11b8ace 100644
--- a/WatchFace.Cmd/packages.config
+++ b/WatchFace/packages.config
@@ -42,7 +42,7 @@
-
+