|
|
|
@ -31,7 +31,7 @@ namespace GBase.DataHandling |
|
|
|
{ |
|
|
|
{ |
|
|
|
//if the xml file isn't empty, return |
|
|
|
//if the xml file isn't empty, return |
|
|
|
if (file.Length > 3) //> 3 because of BOM |
|
|
|
if (file.Length > 3) //> 3 because of BOM |
|
|
|
return false; |
|
|
|
return true; //TODO: Don't return bool? |
|
|
|
|
|
|
|
|
|
|
|
XDocument xmlDocument = new XDocument(); |
|
|
|
XDocument xmlDocument = new XDocument(); |
|
|
|
xmlDocument.Add(new XElement(rootElementName)); |
|
|
|
xmlDocument.Add(new XElement(rootElementName)); |
|
|
|
@ -74,6 +74,7 @@ namespace GBase.DataHandling |
|
|
|
if (typeName == null) |
|
|
|
if (typeName == null) |
|
|
|
throw new ArgumentNullException(nameof(typeName)); |
|
|
|
throw new ArgumentNullException(nameof(typeName)); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
file.Seek(0, SeekOrigin.Begin); //reset stream to it's beginning to be able to save it |
|
|
|
XDocument xmlDocument = await XDocument.LoadAsync(file, LoadOptions.None, cancellationToken); |
|
|
|
XDocument xmlDocument = await XDocument.LoadAsync(file, LoadOptions.None, cancellationToken); |
|
|
|
file.Seek(0, SeekOrigin.Begin); //reset stream to it's beginning to be able to save it |
|
|
|
file.Seek(0, SeekOrigin.Begin); //reset stream to it's beginning to be able to save it |
|
|
|
|
|
|
|
|
|
|
|
|