5 namespace HKI.Core.Settings
15 public override void Save(XmlNode parentNode)
17 XmlNode node = parentNode.OwnerDocument.CreateElement(name.Replace(
" ",
""));
18 parentNode.AppendChild(node);
20 XmlAttribute valueAttribute = parentNode.OwnerDocument.CreateAttribute(
"Value");
21 valueAttribute.Value = ((int)Value).ToString();
22 node.Attributes.Append(valueAttribute);
25 public override void Load(XmlNode node)
27 if (node.Attributes == null)
29 Debug.LogError(
"(FrameRateAndVSyncMode) >" + name +
"< Loading failed because this XmlNode has not attributes!");
33 XmlAttribute valueAttribute = node.Attributes[
"Value"];
34 if (valueAttribute == null)
36 Debug.LogError(
"(FrameRateAndVSyncMode) >" + name +
"< Loading failed because this XmlNode has not an attribute with the name >Value<!");
41 if (
int.TryParse(valueAttribute.Value, out parsedValue))
44 Debug.LogError(
"(FrameRateAndVSyncMode) >" + name +
"< Loading failed because parsing of >" + valueAttribute.Value +
"< failed!");
Special Variable enables the use of the FrameRateAndVSyncModes data type as a variable of the setting...
override void Load(XmlNode node)
override void Save(XmlNode parentNode)
FrameRateAndVSyncModes
All possible settings for frame rate and VSync.
This class adds a generic implementation to HKIVar. This reduces the repetitive implementation of thi...