|
|
@ -3,6 +3,7 @@ using System.Text;
|
|
|
|
using System.Diagnostics.CodeAnalysis;
|
|
|
|
using System.Diagnostics.CodeAnalysis;
|
|
|
|
using System.Xml;
|
|
|
|
using System.Xml;
|
|
|
|
using CoreLibrary.Persistance;
|
|
|
|
using CoreLibrary.Persistance;
|
|
|
|
|
|
|
|
using CoreLibrary.Regles;
|
|
|
|
|
|
|
|
|
|
|
|
namespace Persistance.Persistance
|
|
|
|
namespace Persistance.Persistance
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -54,7 +55,11 @@ namespace Persistance.Persistance
|
|
|
|
if (!File.Exists(fichier))
|
|
|
|
if (!File.Exists(fichier))
|
|
|
|
return [];
|
|
|
|
return [];
|
|
|
|
|
|
|
|
|
|
|
|
DataContractJsonSerializer jsonSerializer = new DataContractJsonSerializer(typeof(T[]));
|
|
|
|
DataContractJsonSerializer jsonSerializer = new DataContractJsonSerializer(
|
|
|
|
|
|
|
|
typeof(T[]),
|
|
|
|
|
|
|
|
typeof(IRegles).Assembly.GetTypes()
|
|
|
|
|
|
|
|
.Where(type => typeof(IRegles).IsAssignableFrom(type) && type.IsClass)
|
|
|
|
|
|
|
|
);
|
|
|
|
T[]? elements;
|
|
|
|
T[]? elements;
|
|
|
|
|
|
|
|
|
|
|
|
using (FileStream s = File.OpenRead(fichier))
|
|
|
|
using (FileStream s = File.OpenRead(fichier))
|
|
|
@ -80,7 +85,11 @@ namespace Persistance.Persistance
|
|
|
|
|
|
|
|
|
|
|
|
Directory.SetCurrentDirectory(Path.Combine(Directory.GetCurrentDirectory(), nomDossier));
|
|
|
|
Directory.SetCurrentDirectory(Path.Combine(Directory.GetCurrentDirectory(), nomDossier));
|
|
|
|
|
|
|
|
|
|
|
|
DataContractJsonSerializer jsonSerializer = new DataContractJsonSerializer(typeof(T[]));
|
|
|
|
DataContractJsonSerializer jsonSerializer = new DataContractJsonSerializer(
|
|
|
|
|
|
|
|
typeof(T[]),
|
|
|
|
|
|
|
|
typeof(IRegles).Assembly.GetTypes()
|
|
|
|
|
|
|
|
.Where(type => typeof(IRegles).IsAssignableFrom(type) && type.IsClass)
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
using (FileStream s = File.Create(fichier))
|
|
|
|
using (FileStream s = File.Create(fichier))
|
|
|
|
{
|
|
|
|
{
|
|
|
|