Closed mlveggo closed 3 years ago
A bunch of fields are missing the special treatment. Even if they are unlikely to fail I think it's good to have a uniform approach.
see public struct SettingsExternalTimeBase
Adding a new member in settingsexternaltimebase structure will not cause a xml deserialization exception. Only enum types require this treatment.
public struct SettingsExternalTimeBase
{
[XmlElement("Enabled")]
public bool Enabled;
[XmlElement("Signal_Source")]
public SignalSource SignalSource; <-- member field missing special treatment
[XmlElement("Signal_Mode")]
public SignalMode SignalMode; <-- member field missing special treatment
[XmlElement("Frequency_Multiplier")]
public int FreqMultiplier;
[XmlElement("Frequency_Divisor")]
public int FreqDivisor;
[XmlElement("Frequency_Tolerance")]
public int FreqTolerance;
[XmlElement("Nominal_Frequency")]
public float NominalFrequency;
[XmlElement("Signal_Edge")]
public SignalEdge SignalEdge; <-- member field missing special treatment
[XmlElement("Signal_Shutter_Delay")]
public int SignalShutterDelay;
[XmlElement("Non_Periodic_Timeout")]
public float NonPeriodicTimeout;
}
Now all enum types have a Unknown value which it will default to if xml parsing isn't possible (no throws in deserialization).