WIP on new elemens
parent
1c3663b65d
commit
948fd521cc
|
@ -4,6 +4,7 @@
|
||||||
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/PLACE_ACCESSORHOLDER_ATTRIBUTE_ON_SAME_LINE_EX/@EntryValue">NEVER</s:String>
|
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/PLACE_ACCESSORHOLDER_ATTRIBUTE_ON_SAME_LINE_EX/@EntryValue">NEVER</s:String>
|
||||||
<s:String x:Key="/Default/Environment/Hierarchy/PsiConfigurationSettingsKey/CustomLocation/@EntryValue">C:\Users\valeronm\AppData\Local\JetBrains\Transient\ReSharperPlatformVs15\v11_048a238b\SolutionCaches</s:String>
|
<s:String x:Key="/Default/Environment/Hierarchy/PsiConfigurationSettingsKey/CustomLocation/@EntryValue">C:\Users\valeronm\AppData\Local\JetBrains\Transient\ReSharperPlatformVs15\v11_048a238b\SolutionCaches</s:String>
|
||||||
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ECSharpKeepExistingMigration/@EntryIndexedValue">True</s:Boolean>
|
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ECSharpKeepExistingMigration/@EntryIndexedValue">True</s:Boolean>
|
||||||
|
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ECSharpUseContinuousIndentInsideBracesMigration/@EntryIndexedValue">True</s:Boolean>
|
||||||
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ESettingsUpgrade_002ECSharpPlaceAttributeOnSameLineMigration/@EntryIndexedValue">True</s:Boolean>
|
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ESettingsUpgrade_002ECSharpPlaceAttributeOnSameLineMigration/@EntryIndexedValue">True</s:Boolean>
|
||||||
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ESettingsUpgrade_002EMigrateBlankLinesAroundFieldToBlankLinesAroundProperty/@EntryIndexedValue">True</s:Boolean>
|
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ESettingsUpgrade_002EMigrateBlankLinesAroundFieldToBlankLinesAroundProperty/@EntryIndexedValue">True</s:Boolean>
|
||||||
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ESettingsUpgrade_002EMigrateThisQualifierSettings/@EntryIndexedValue">True</s:Boolean>
|
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ESettingsUpgrade_002EMigrateThisQualifierSettings/@EntryIndexedValue">True</s:Boolean>
|
||||||
|
|
|
@ -15,5 +15,8 @@ namespace WatchFace.Parser.Elements.ActivityElements
|
||||||
[ParameterId(3)]
|
[ParameterId(3)]
|
||||||
[ParameterImageIndex]
|
[ParameterImageIndex]
|
||||||
public long? DecimalPointImageIndex { get; set; }
|
public long? DecimalPointImageIndex { get; set; }
|
||||||
|
|
||||||
|
[ParameterId(4)]
|
||||||
|
public long? SuffixMilesImageIndex { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -0,0 +1,29 @@
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using Newtonsoft.Json.Converters;
|
||||||
|
using WatchFace.Parser.Attributes;
|
||||||
|
using WatchFace.Parser.Models;
|
||||||
|
|
||||||
|
namespace WatchFace.Parser.Elements.BasicElements
|
||||||
|
{
|
||||||
|
public class UnknownType
|
||||||
|
{
|
||||||
|
[ParameterId(1)]
|
||||||
|
public long TopLeftX { get; set; }
|
||||||
|
|
||||||
|
[ParameterId(2)]
|
||||||
|
public long TopLeftY { get; set; }
|
||||||
|
|
||||||
|
[ParameterId(3)]
|
||||||
|
public long BottomRightX { get; set; }
|
||||||
|
|
||||||
|
[ParameterId(4)]
|
||||||
|
public long BottomRightY { get; set; }
|
||||||
|
|
||||||
|
[ParameterId(5)]
|
||||||
|
[JsonConverter(typeof(StringEnumConverter))]
|
||||||
|
public TextAlignment Alignment { get; set; }
|
||||||
|
|
||||||
|
[ParameterId(6)]
|
||||||
|
public long Spacing { get; set; }
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,19 @@
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using Newtonsoft.Json.Converters;
|
||||||
|
using WatchFace.Parser.Attributes;
|
||||||
|
using WatchFace.Parser.Models;
|
||||||
|
|
||||||
|
namespace WatchFace.Parser.Elements.BasicElements
|
||||||
|
{
|
||||||
|
public class UnknownType14d6
|
||||||
|
{
|
||||||
|
[ParameterId(1)]
|
||||||
|
public Coordinates Unknown1 { get; set; }
|
||||||
|
|
||||||
|
[ParameterId(2)]
|
||||||
|
public Coordinates Unknown2 { get; set; }
|
||||||
|
|
||||||
|
[ParameterId(3)]
|
||||||
|
public long? Unknown3 { get; set; }
|
||||||
|
}
|
||||||
|
}
|
|
@ -13,5 +13,11 @@ namespace WatchFace.Parser.Elements
|
||||||
|
|
||||||
[ParameterId(3)]
|
[ParameterId(3)]
|
||||||
public Scale Scale { get; set; }
|
public Scale Scale { get; set; }
|
||||||
|
|
||||||
|
[ParameterId(5)]
|
||||||
|
public long? Unknown5 { get; set; }
|
||||||
|
|
||||||
|
[ParameterId(6)]
|
||||||
|
public long? Unknown6 { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -11,5 +11,11 @@ namespace WatchFace.Parser.Elements
|
||||||
|
|
||||||
[ParameterId(2)]
|
[ParameterId(2)]
|
||||||
public ImageSet WeekDay { get; set; }
|
public ImageSet WeekDay { get; set; }
|
||||||
|
|
||||||
|
[ParameterId(3)]
|
||||||
|
public DateUnknown3 Unknown3 { get; set; }
|
||||||
|
|
||||||
|
[ParameterId(4)]
|
||||||
|
public Coordinates Unknown4 { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -0,0 +1,11 @@
|
||||||
|
using WatchFace.Parser.Attributes;
|
||||||
|
using WatchFace.Parser.Elements.BasicElements;
|
||||||
|
|
||||||
|
namespace WatchFace.Parser.Elements.DateElements
|
||||||
|
{
|
||||||
|
public class DateUnknown3
|
||||||
|
{
|
||||||
|
[ParameterId(2)]
|
||||||
|
public UnknownType Unknown2 { get; set; }
|
||||||
|
}
|
||||||
|
}
|
|
@ -22,5 +22,8 @@ namespace WatchFace.Parser.Elements
|
||||||
[JsonConverter(typeof(DrawingOrderJsonConverter))]
|
[JsonConverter(typeof(DrawingOrderJsonConverter))]
|
||||||
[ParameterId(5)]
|
[ParameterId(5)]
|
||||||
public long? DrawingOrder { get; set; }
|
public long? DrawingOrder { get; set; }
|
||||||
|
|
||||||
|
[ParameterId(9)]
|
||||||
|
public long? Unknown9 { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -0,0 +1,26 @@
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using WatchFace.Parser.Attributes;
|
||||||
|
using WatchFace.Parser.Elements.BasicElements;
|
||||||
|
using WatchFace.Parser.Elements.TimeElements;
|
||||||
|
using WatchFace.Parser.JsonConverters;
|
||||||
|
|
||||||
|
namespace WatchFace.Parser.Elements
|
||||||
|
{
|
||||||
|
public class UnknownType14
|
||||||
|
{
|
||||||
|
[ParameterId(1)]
|
||||||
|
public TwoDigits Unknown1 { get; set; }
|
||||||
|
|
||||||
|
[ParameterId(2)]
|
||||||
|
public TwoDigits Unknown2 { get; set; }
|
||||||
|
|
||||||
|
[ParameterId(6)]
|
||||||
|
public UnknownType14d6 Unknown6 { get; set; }
|
||||||
|
|
||||||
|
[ParameterId(7)]
|
||||||
|
public UnknownType14d6 Unknown7 { get; set; }
|
||||||
|
|
||||||
|
[ParameterId(8)]
|
||||||
|
public UnknownType14d6 Unknown8 { get; set; }
|
||||||
|
}
|
||||||
|
}
|
|
@ -15,8 +15,6 @@ namespace WatchFace.Parser.Utils
|
||||||
var result = new List<Parameter>();
|
var result = new List<Parameter>();
|
||||||
var currentType = typeof(T);
|
var currentType = typeof(T);
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(path))
|
|
||||||
Logger.Trace("{0} '{1}'", path, currentType.Name);
|
|
||||||
foreach (var kv in ElementsHelper.SortedProperties<T>())
|
foreach (var kv in ElementsHelper.SortedProperties<T>())
|
||||||
{
|
{
|
||||||
var id = kv.Key;
|
var id = kv.Key;
|
||||||
|
@ -52,13 +50,19 @@ namespace WatchFace.Parser.Utils
|
||||||
else if (propertyType.IsGenericType && propertyType.GetGenericTypeDefinition() == typeof(List<>))
|
else if (propertyType.IsGenericType && propertyType.GetGenericTypeDefinition() == typeof(List<>))
|
||||||
{
|
{
|
||||||
foreach (var item in propertyValue)
|
foreach (var item in propertyValue)
|
||||||
|
{
|
||||||
|
Logger.Trace("{0} '{1}'", currentPath, propertyInfo.Name);
|
||||||
result.Add(new Parameter(id, Build(item, currentPath)));
|
result.Add(new Parameter(id, Build(item, currentPath)));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
var innerParameters = Build(propertyValue, currentPath);
|
var innerParameters = Build(propertyValue, currentPath);
|
||||||
if (innerParameters.Count > 0)
|
if (innerParameters.Count > 0)
|
||||||
|
{
|
||||||
|
Logger.Trace("{0} '{1}'", currentPath, propertyInfo.Name);
|
||||||
result.Add(new Parameter(id, innerParameters));
|
result.Add(new Parameter(id, innerParameters));
|
||||||
|
}
|
||||||
else
|
else
|
||||||
Logger.Trace("{0} '{1}': Skipped because of empty", currentPath, propertyInfo.Name);
|
Logger.Trace("{0} '{1}': Skipped because of empty", currentPath, propertyInfo.Name);
|
||||||
}
|
}
|
||||||
|
@ -75,8 +79,6 @@ namespace WatchFace.Parser.Utils
|
||||||
|
|
||||||
var thisMethod = typeof(ParametersConverter).GetMethod(nameof(Parse));
|
var thisMethod = typeof(ParametersConverter).GetMethod(nameof(Parse));
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(path))
|
|
||||||
Logger.Trace("{0} '{1}'", path, currentType.Name);
|
|
||||||
foreach (var parameter in descriptor)
|
foreach (var parameter in descriptor)
|
||||||
{
|
{
|
||||||
var currentPath = string.IsNullOrEmpty(path)
|
var currentPath = string.IsNullOrEmpty(path)
|
||||||
|
@ -111,6 +113,7 @@ namespace WatchFace.Parser.Utils
|
||||||
}
|
}
|
||||||
else if (propertyType.IsGenericType && propertyType.GetGenericTypeDefinition() == typeof(List<>))
|
else if (propertyType.IsGenericType && propertyType.GetGenericTypeDefinition() == typeof(List<>))
|
||||||
{
|
{
|
||||||
|
Logger.Trace("{0} '{1}'", currentPath, propertyInfo.Name);
|
||||||
dynamic propertyValue = propertyInfo.GetValue(result, null);
|
dynamic propertyValue = propertyInfo.GetValue(result, null);
|
||||||
if (propertyValue == null)
|
if (propertyValue == null)
|
||||||
{
|
{
|
||||||
|
@ -132,6 +135,7 @@ namespace WatchFace.Parser.Utils
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
Logger.Trace("{0} '{1}'", currentPath, propertyInfo.Name);
|
||||||
dynamic propertyValue = propertyInfo.GetValue(result, null);
|
dynamic propertyValue = propertyInfo.GetValue(result, null);
|
||||||
if (propertyValue != null)
|
if (propertyValue != null)
|
||||||
throw new ArgumentException($"Parameter {parameter.Id} is already set for {currentType.Name}");
|
throw new ArgumentException($"Parameter {parameter.Id} is already set for {currentType.Name}");
|
||||||
|
|
|
@ -59,16 +59,20 @@
|
||||||
<Compile Include="Elements\BasicElements\Coordinates.cs" />
|
<Compile Include="Elements\BasicElements\Coordinates.cs" />
|
||||||
<Compile Include="Elements\BasicElements\Image.cs" />
|
<Compile Include="Elements\BasicElements\Image.cs" />
|
||||||
<Compile Include="Elements\BasicElements\ImageSet.cs" />
|
<Compile Include="Elements\BasicElements\ImageSet.cs" />
|
||||||
|
<Compile Include="Elements\BasicElements\UnknownType14d6.cs" />
|
||||||
|
<Compile Include="Elements\BasicElements\UnknownType.cs" />
|
||||||
<Compile Include="Elements\BasicElements\Number.cs" />
|
<Compile Include="Elements\BasicElements\Number.cs" />
|
||||||
<Compile Include="Elements\BasicElements\Scale.cs" />
|
<Compile Include="Elements\BasicElements\Scale.cs" />
|
||||||
<Compile Include="Elements\Battery.cs" />
|
<Compile Include="Elements\Battery.cs" />
|
||||||
<Compile Include="Elements\Date.cs" />
|
<Compile Include="Elements\Date.cs" />
|
||||||
|
<Compile Include="Elements\DateElements\DateUnknown3.cs" />
|
||||||
<Compile Include="Elements\DateElements\MonthAndDay.cs" />
|
<Compile Include="Elements\DateElements\MonthAndDay.cs" />
|
||||||
<Compile Include="Elements\DateElements\OneLineMonthAndDay.cs" />
|
<Compile Include="Elements\DateElements\OneLineMonthAndDay.cs" />
|
||||||
<Compile Include="Elements\DateElements\SeparateMonthAndDay.cs" />
|
<Compile Include="Elements\DateElements\SeparateMonthAndDay.cs" />
|
||||||
<Compile Include="Elements\StepsProgress.cs" />
|
<Compile Include="Elements\StepsProgress.cs" />
|
||||||
<Compile Include="Elements\Status.cs" />
|
<Compile Include="Elements\Status.cs" />
|
||||||
<Compile Include="Elements\StatusElements\Switch.cs" />
|
<Compile Include="Elements\StatusElements\Switch.cs" />
|
||||||
|
<Compile Include="Elements\UnknownType14.cs" />
|
||||||
<Compile Include="Elements\Time.cs" />
|
<Compile Include="Elements\Time.cs" />
|
||||||
<Compile Include="Elements\TimeElements\AmPm.cs" />
|
<Compile Include="Elements\TimeElements\AmPm.cs" />
|
||||||
<Compile Include="Elements\TimeElements\TwoDigits.cs" />
|
<Compile Include="Elements\TimeElements\TwoDigits.cs" />
|
||||||
|
|
|
@ -31,5 +31,8 @@ namespace WatchFace.Parser
|
||||||
|
|
||||||
[ParameterId(10)]
|
[ParameterId(10)]
|
||||||
public AnalogDialFace AnalogDialFace { get; set; }
|
public AnalogDialFace AnalogDialFace { get; set; }
|
||||||
|
|
||||||
|
[ParameterId(14)]
|
||||||
|
public UnknownType14 Unknown14 { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue