|
|
@ -5,6 +5,7 @@ using System.Linq;
|
|
|
|
using System.Runtime.Serialization;
|
|
|
|
using System.Runtime.Serialization;
|
|
|
|
using System.Text;
|
|
|
|
using System.Text;
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
|
|
using System.Xml;
|
|
|
|
|
|
|
|
|
|
|
|
namespace CanYouBuildIt.DataContractPersistance
|
|
|
|
namespace CanYouBuildIt.DataContractPersistance
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -37,13 +38,15 @@ namespace CanYouBuildIt.DataContractPersistance
|
|
|
|
Directory.CreateDirectory(FilePath);
|
|
|
|
Directory.CreateDirectory(FilePath);
|
|
|
|
File.Create(Path.Combine(FilePath, FileName));
|
|
|
|
File.Create(Path.Combine(FilePath, FileName));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
var settings = new XmlWriterSettings() { Indent = true };
|
|
|
|
|
|
|
|
using (TextWriter tw = File.CreateText(Path.Combine(FilePath, FileName)))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
using (Stream stream = File.OpenWrite(Path.Combine(FilePath, FileName)))
|
|
|
|
using (XmlWriter writer = XmlWriter.Create(tw, settings))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
serializer.WriteObject(stream, lu);
|
|
|
|
serializer.WriteObject(writer, lu);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|