debut ajout persistence(stub surtout) pour pouvoir faire binding
continuous-integration/drone/push Build is failing Details

pull/19/head
Liam MONCHANIN 2 years ago
parent 2104545171
commit 6af577e2f2

@ -14,6 +14,8 @@ namespace Biblioteque_de_Class
public void SaveUserData(User user); public void SaveUserData(User user);
public User LoadUserData(); public List<User> LoadUserData();
//public List<Note> LoadNote();
} }
} }

@ -26,7 +26,7 @@ namespace Biblioteque_de_Class
persistence.SaveUserData(user); persistence.SaveUserData(user);
} }
public User LoadUserData() public List<User> LoadUserData()
{ {
return persistence.LoadUserData(); return persistence.LoadUserData();
} }

@ -2,6 +2,8 @@
using System.ComponentModel.DataAnnotations.Schema; using System.ComponentModel.DataAnnotations.Schema;
using System.Diagnostics; using System.Diagnostics;
using System.Linq.Expressions; using System.Linq.Expressions;
using System.Runtime.InteropServices;
using Notus_Persistance;
string Upseudo = "u"; string Upseudo = "u";
string Umail = "u"; string Umail = "u";
@ -21,12 +23,7 @@ string choix;
string color = "u"; string color = "u";
string color2; string color2;
string color3; string color3;
List<string> NewColorList = new List<string> { };
List<string> listCouleurs = new List<string> { };
List<Note> _searchedNotes;
List<Note> NoteListe;
List<Tags> _searchedTags;
List<User> UserListe;
User user = new User(Upseudo, Umail, Upassword); User user = new User(Upseudo, Umail, Upassword);
NoteImage image = new NoteImage(nomImage, linkimage, position); NoteImage image = new NoteImage(nomImage, linkimage, position);
@ -35,6 +32,20 @@ User u = new User(Upseudo, Umail, Upassword);
Note n = new Note(nomNote, logoPath, u); Note n = new Note(nomNote, logoPath, u);
Tags t = new Tags(NomTag, color); Tags t = new Tags(NomTag, color);
List<string> NewColorList = new List<string> { };
List<string> listCouleurs = new List<string> { };
List<Note> _searchedNotes;
List<Note> NoteListe;
List<Tags> _searchedTags;
List<User> UserListe; // = IManager.LoadUserData(); /// Essai de load via Imanager
foreach (User us in UserListe) /// Test du stub
{
Console.WriteLine("Coucou");
}
return;
int boucle = 0; int boucle = 0;
while (boucle == 0) while (boucle == 0)
{ {

@ -10,25 +10,46 @@ namespace Notus_Persistance
{ {
internal class Stub : IManager internal class Stub : IManager
{ {
public void SaveDatabaseData(Database database) void IManager.SaveDatabaseData(Database database)
{ {
throw new NotImplementedException(); throw new NotImplementedException();
} }
public Database LoadDatabaseData() Database IManager.LoadDatabaseData()
{ {
throw new NotImplementedException(); Database database = new Database();
database.AddUser(new User("Nicolas", "leHeros@gmail.com", "Feur"));
database.AddUser(new User("Benjamin", "labsent@gmail.com", "Moto2005"));
database.AddUser(new User("Liam", "liammonchanin@gmail.com", "Baguette"));
database.AddUser(new User("Brigitte", "Macroutte@gmail.com", "49Trois"));
return database;
} }
public void SaveUserData(User user) void IManager.SaveUserData(User user)
{ {
throw new NotImplementedException(); throw new NotImplementedException();
} }
public User LoadUserData() List <User> IManager.LoadUserData()
{ {
throw new NotImplementedException(); List<User> users = new List<User>();
users.Add(new User("Nicolas", "leHeros@gmail.com", "Feur"));
users.Add(new User("Benjamin", "labsent@gmail.com", "Moto2005"));
users.Add(new User("Liam", "liammonchanin@gmail.com", "Baguette"));
users.Add(new User("Brigitte", "Macroutte@gmail.com", "49Trois"));
return users;
} }
/*List<Note> IManager.LoadNote()
{
List <Note> notes = new List<Note>();
notes.Add(new Note("Note_1", "Logo_1",new User("Liam","Liam@gmail.com","Oui")));
notes.Add(new Note("Note_2", "Logo_3", new User("Liam", "Liam@gmail.com", "Oui")));
notes.Add(new Note("Note_3", "Logo_5", new User("Liam", "Liam@gmail.com", "Oui")));
notes.Add(new Note("Note_4", "Logo_7", new User("Liam", "Liam@gmail.com", "Oui")));
notes.Add(new Note("Note_5", "Logo_9", new User("Liam", "Liam@gmail.com", "Oui")));
return notes;
}*/
} }
} }

@ -71,8 +71,9 @@ namespace Notus_Persistance
} }
} }
public User LoadUserData() public List<User> LoadUserData()
{ {
List<User> users = new List<User>();
if (File.Exists(UserDataFilePath)) if (File.Exists(UserDataFilePath))
{ {
User user1; User user1;
@ -85,7 +86,9 @@ namespace Notus_Persistance
} }
else else
{ {
return user1 = user; user1 = user;
users.Add(user1);
return users;
} }
} }
} }

@ -30,7 +30,7 @@ namespace Notus_Persistance
throw new NotImplementedException(); throw new NotImplementedException();
} }
public User LoadUserData() public List<User> LoadUserData()
{ {
throw new NotImplementedException(); throw new NotImplementedException();
} }

@ -1,4 +1,5 @@
namespace notus; 
namespace notus;
public partial class App : Application public partial class App : Application
{ {
@ -8,4 +9,6 @@ public partial class App : Application
MainPage = new AppShell(); MainPage = new AppShell();
} }
} }

@ -100,19 +100,20 @@
PlaceholderColor="#74fabd" PlaceholderColor="#74fabd"
/> />
<Entry <Editor
Placeholder="Texte" Placeholder="Texte"
HorizontalOptions="Start" HorizontalOptions="Start"
VerticalOptions="Center" VerticalOptions="Center"
Margin="20"
WidthRequest="670"
HeightRequest="670"
Grid.Column="1" Grid.Column="1"
Grid.ColumnSpan="2" Grid.ColumnSpan="4"
Grid.Row="4"
Grid.RowSpan="3" Grid.RowSpan="3"
TextColor="Black" TextColor="Black"
BackgroundColor="#4A4A4A" BackgroundColor="#4A4A4A"
PlaceholderColor="#74fabd" PlaceholderColor="#74fabd"
/> />
</Grid> </Grid>
</ContentPage> </ContentPage>
Loading…
Cancel
Save