private static void AssignField(object tagObject, TagTypeInfo typeInfo, string field, string value) { if (typeInfo.Fields.TryGetValue(field, out TagFieldInfo tagFieldInfo)) { SetFieldValue(tagObject, tagFieldInfo, value); } else { throw new InterpreterException("Field: " + field + " of " + typeInfo.Type + " could not be found"); } }
private static void AssignDefaultField(object tagObject, TagTypeInfo typeInfo, string value) { foreach (var tagFieldInfo in typeInfo.Fields.Values) { if (tagFieldInfo.Attribute.IsDefault) { SetFieldValue(tagObject, tagFieldInfo, value); return; } } throw new InterpreterException("Default field of " + typeInfo.Type + "was not found"); }