propertyElement=newXElement(propertyName,newXElement(XmlDataHandler.VALUE_ELEMENT_NAME){Value=value});//create the new property element with the value element
propertyElement.SetAttributeValue(XmlDataHandler.VALUE_TYPE_ATTRIBUTE_NAME,typeof(TProperty).FullName);//add the property type attribute
typeElement.Add(propertyElement);//create new property element with the value element
}
}
else//type element doesn't exist
{
XElementpropertyElement=newXElement(propertyName,newXElement(XmlDataHandler.VALUE_ELEMENT_NAME){Value=value});//create the new property element with the value element
propertyElement.SetAttributeValue(XmlDataHandler.VALUE_TYPE_ATTRIBUTE_NAME,typeof(TProperty).FullName);//add the property type attribute
_rootElement.Add(newXElement(typeName,propertyElement));//create a new type element with the new property element
rootElement.Add(propertyElement);//create new property element with the value element
}
//TODO: check if whole file is overwritten (probably) -> performance issues for large files?
@ -107,19 +101,27 @@ namespace GBase.DataHandling
/// </summary>
/// <typeparam name="T">The <see cref="Type"/> of the property</typeparam>
/// <typeparam name="TProperty">The <see cref="Type"/> of the property</typeparam>
/// <param name="file"></param>
/// <param name="propertyName">The name of the property</param>
/// <param name="value">The value to set</param>
/// <param name="cancellationToken"></param>
/// <returns>A <see cref="Task"/> to await</returns>