diff --git a/LOLAPP/LOLAPP.sln b/LOLAPP/LOLAPP.sln new file mode 100644 index 0000000..63c19f9 --- /dev/null +++ b/LOLAPP/LOLAPP.sln @@ -0,0 +1,27 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.0.31611.283 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LOLAPP", "LOLAPP\LOLAPP.csproj", "{736A464D-D35B-47BD-AC29-04E11BFF186F}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {736A464D-D35B-47BD-AC29-04E11BFF186F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {736A464D-D35B-47BD-AC29-04E11BFF186F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {736A464D-D35B-47BD-AC29-04E11BFF186F}.Debug|Any CPU.Deploy.0 = Debug|Any CPU + {736A464D-D35B-47BD-AC29-04E11BFF186F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {736A464D-D35B-47BD-AC29-04E11BFF186F}.Release|Any CPU.Build.0 = Release|Any CPU + {736A464D-D35B-47BD-AC29-04E11BFF186F}.Release|Any CPU.Deploy.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {61F7FB11-1E47-470C-91E2-47F8143E1572} + EndGlobalSection +EndGlobal diff --git a/LOLAPP/LOLAPP/App.xaml b/LOLAPP/LOLAPP/App.xaml new file mode 100644 index 0000000..55b0871 --- /dev/null +++ b/LOLAPP/LOLAPP/App.xaml @@ -0,0 +1,14 @@ + + + + + + + + + + + diff --git a/LOLAPP/LOLAPP/App.xaml.cs b/LOLAPP/LOLAPP/App.xaml.cs new file mode 100644 index 0000000..1776a72 --- /dev/null +++ b/LOLAPP/LOLAPP/App.xaml.cs @@ -0,0 +1,17 @@ +using LOLAPP.Modele; + +namespace LOLAPP; + +public partial class App : Application +{ + + public Manager ChampionManager { get; private set; } = new Manager(new Stub()); + public App() + { + ChampionManager.Chargement(); + ChampionManager.Sauvegarde(); + InitializeComponent(); + + MainPage = new AppShell(); + } +} diff --git a/LOLAPP/LOLAPP/AppShell.xaml b/LOLAPP/LOLAPP/AppShell.xaml new file mode 100644 index 0000000..0cd8fa1 --- /dev/null +++ b/LOLAPP/LOLAPP/AppShell.xaml @@ -0,0 +1,14 @@ + + + + + + diff --git a/LOLAPP/LOLAPP/AppShell.xaml.cs b/LOLAPP/LOLAPP/AppShell.xaml.cs new file mode 100644 index 0000000..2697b36 --- /dev/null +++ b/LOLAPP/LOLAPP/AppShell.xaml.cs @@ -0,0 +1,9 @@ +namespace LOLAPP; + +public partial class AppShell : Shell +{ + public AppShell() + { + InitializeComponent(); + } +} diff --git a/LOLAPP/LOLAPP/DataContactPersistance/DataContract.cs b/LOLAPP/LOLAPP/DataContactPersistance/DataContract.cs new file mode 100644 index 0000000..59cebb6 --- /dev/null +++ b/LOLAPP/LOLAPP/DataContactPersistance/DataContract.cs @@ -0,0 +1,47 @@ +using LOLAPP.Modele; +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Linq; +using System.Runtime.Serialization; +using System.Text; +using System.Threading.Tasks; + +namespace LOLAPP.DataContactPersistance +{ + public class DataContract : IPersistanceManager + { + public string FilePath2 {get; set;} = Path.Combine(Directory.GetCurrentDirectory(),"//Doss1_XML"); + public string FileName { get; set; } = "Test2.xml"; + public string FilePath { get; set; } = "C\\Users\\cecharbonn5\\SAE#\\LOLAPP.XML"; + public (List, List) Chargdon() + { + var serializer = new DataContractSerializer(typeof(List)); + + List list; + + using(Stream s = File.OpenRead(Path.Combine(FilePath, FileName))) + { + list = serializer.ReadObject(s) as List; + } + return (new List(), list); + } + + public void Sauvdon(List s, List c) + { + var serializer = new DataContractSerializer(typeof(List)); + if (!Directory.Exists(FilePath)) + { + Debug.WriteLine("Directory crée à l'instant"); + Debug.WriteLine(Directory.GetDirectoryRoot); + Debug.WriteLine(FilePath); + Directory.CreateDirectory(FilePath); + } + + using (Stream st = File.Create(Path.Combine(FilePath,FileName))) + { + serializer.WriteObject(st, c); + } + } + } +} diff --git a/LOLAPP/LOLAPP/LOLAPP.csproj b/LOLAPP/LOLAPP/LOLAPP.csproj new file mode 100644 index 0000000..18a6d92 --- /dev/null +++ b/LOLAPP/LOLAPP/LOLAPP.csproj @@ -0,0 +1,55 @@ + + + + net7.0-android;net7.0-ios;net7.0-maccatalyst + $(TargetFrameworks);net7.0-windows10.0.19041.0 + + + Exe + LOLAPP + true + true + enable + + + LOLAPP + + + com.companyname.lolapp + 8d0f721c-c2d2-4ddd-a136-827e3bde1ffd + + + 1.0 + 1 + + 11.0 + 13.1 + 21.0 + 10.0.17763.0 + 10.0.17763.0 + 6.5 + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/LOLAPP/LOLAPP/MainPage.xaml b/LOLAPP/LOLAPP/MainPage.xaml new file mode 100644 index 0000000..7695ff7 --- /dev/null +++ b/LOLAPP/LOLAPP/MainPage.xaml @@ -0,0 +1,59 @@ + + + + + + + + + + + + + + + + + + + + + + + + +