private static void LoadUserProperties(DataElement container, PropertiesContainer properties) { IDictionary<string, IProperty> propertiesMap = properties.UserProperties; foreach(DataElement element in container.CollectChildren("property")) { string name = element.GetAttribValue("name"); IProperty property; if(propertiesMap.TryGetValue(name, out property)) { string valueStr = element.GetAttribValue("value"); string errorStr = property.TrySetValue(valueStr); if(errorStr != null) { throw new InvalidDataException(); } } } }