|
|
|
@ -3,6 +3,7 @@ using System.Text;
|
|
|
|
|
using System.Diagnostics.CodeAnalysis;
|
|
|
|
|
using System.Xml;
|
|
|
|
|
using CoreLibrary.Persistance;
|
|
|
|
|
using CoreLibrary.Regles;
|
|
|
|
|
|
|
|
|
|
namespace Persistance.Persistance
|
|
|
|
|
{
|
|
|
|
@ -54,7 +55,11 @@ namespace Persistance.Persistance
|
|
|
|
|
if (!File.Exists(fichier))
|
|
|
|
|
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;
|
|
|
|
|
|
|
|
|
|
using (FileStream s = File.OpenRead(fichier))
|
|
|
|
@ -80,7 +85,11 @@ namespace Persistance.Persistance
|
|
|
|
|
|
|
|
|
|
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))
|
|
|
|
|
{
|
|
|
|
|