public override void Parse() { foreach (var childElement in SourceNode.Elements().ToList()) { switch (childElement.Name.ToString()) { case "struct": ApplyFoo(childElement, false); break; } } }
public override void ApplyProperties() { foreach (var childElement in SourceNode.Elements().ToList()) { var elementValue = childElement.Value; switch (childElement.Name.ToString()) { case "name": Name = elementValue; ParentValuePath.AddRange(Parent.ParentValuePath); ParentValuePath.Add(Name); break; case "address": if (!HasOffset) { //StartAddress = ParseAddress(elementValue, Parent.ChildOffset); //StartAddress = Parent.StartAddress + Offset; } break; case "type": break; default: if (!childElement.Name.ToString().StartsWith("int_")) { Debug.WriteLine( $"ApplyProperties: Unknown element {childElement.Name} at {((IXmlLineInfo) childElement).LineNumber}"); } break; } } ValuePath = string.Join(".", ParentValuePath); }
public override void ApplyProperties() { ApplyType(); foreach (var childElement in SourceNode.Elements()) { var elementValue = childElement.Value; switch (childElement.Name.ToString()) { case "name": Name = elementValue; VstParameterName = elementValue; ParentValuePath.AddRange(Parent.ParentValuePath); ParentValuePath.Add(Name); break; case "address": if (!HasOffset) { //Offset = ParseAddress(elementValue, Parent.StartAddress); //StartAddress = Parent.StartAddress + Offset; } break; case "size": IsAutoCalculatedSize = false; Size = ParseSize(elementValue); break; case "default": DefaultValue = elementValue; break; case "range": Range = elementValue; break; case "type": break; /*case "size": * Size = ApplySize(ParseSize(elementValue)); * break;*/ default: Debug.WriteLine( $"RolandValue.ApplyProperties: Unknown element {childElement.Name} at line {((IXmlLineInfo) childElement).LineNumber}"); break; } } ValuePath = string.Join(".", ParentValuePath); if (IsAutoCalculatedSize) { CalculateSize(); } CalculatedSize = GetTypeSize(); FileSize = Size; DoCallback("RolandValue.AfterParse"); }