You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
94 lines
2.9 KiB
94 lines
2.9 KiB
using Microsoft.VisualBasic.FileIO;
|
|
using System.ComponentModel;
|
|
using System.ComponentModel.DataAnnotations.Schema;
|
|
|
|
///https://learn.microsoft.com/fr-fr/windows/apps/design/
|
|
///https://learn.microsoft.com/fr-fr/windows/apps/design/layout/
|
|
///https://raw.githubusercontent.com/dotnet-architecture/eBooks/main/current/maui/Enterprise-Application-Patterns-Using-.NET-MAUI.pdf
|
|
///
|
|
namespace Biblioteque_de_Class
|
|
{
|
|
public class Utilisateur
|
|
{
|
|
private string Pseudo { get; set; }
|
|
private string Mail { get; set; }
|
|
private string Mdp { get; set; }
|
|
private List<Note> NoteList;
|
|
private List<Tags> TagList;
|
|
private List<Note> ListFav;
|
|
private bool connecté { get; set; }
|
|
|
|
public Utilisateur(string Upseudo, string Umail, string Upassword)
|
|
{
|
|
Pseudo = Upseudo;
|
|
Mail = Umail;
|
|
Mdp = Upassword;
|
|
NoteList = new List<Note>();
|
|
}
|
|
|
|
public override string ToString() => $"pseudo : {Pseudo}\nmail : {Mail}\npassword : {Mdp}\nNote possédé : {NoteList.Count}";
|
|
|
|
public bool AjouterFav(List<Note> ListFav, Note note)
|
|
{
|
|
foreach(Note notefav in ListFav)
|
|
{
|
|
if (!notefav.Equals(note))
|
|
{
|
|
ListFav.Add(note);
|
|
return true;
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
|
|
public bool SuppFav(List<Note> ListFav, Note note)
|
|
{
|
|
foreach (Note notefav in ListFav)
|
|
{
|
|
if (notefav.Nom.Equals(note))
|
|
{
|
|
ListFav.Remove(note);
|
|
return true;
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
|
|
public void AjouterNote(string nom, string LogoPath)
|
|
{
|
|
Note note = new Note(nom, LogoPath,this);
|
|
NoteList.Add(note);
|
|
}
|
|
|
|
public void SuppNote(Note note)
|
|
{
|
|
if (NoteList.Contains(note))
|
|
NoteList.Remove(note);
|
|
}
|
|
|
|
/*public void AjouterTag(List<Tags> listNote, string name) {
|
|
foreach(Tags tag in listNote)
|
|
{
|
|
if(tag.Nom == name)
|
|
{
|
|
atributionTag.Add(tag);
|
|
}
|
|
}
|
|
throw new Exception("no tag find with this name");
|
|
}
|
|
|
|
public void SupTag(string name)
|
|
{
|
|
foreach(Tags tag in atributionTag)
|
|
{
|
|
if(tag.Nom == name)
|
|
{
|
|
atributionTag.Remove(tag);
|
|
}
|
|
}
|
|
throw new Exception("no tag find with this name");
|
|
}*/
|
|
|
|
/// Je laisse en attendant, sur l'uml c'est dans utilisateur mais y a les methodes dans note
|
|
}
|
|
} |