From 367efb149938a698e43d4731a45b8029acaafc6a Mon Sep 17 00:00:00 2001 From: Roxane ROSSETTO Date: Mon, 22 May 2023 11:54:36 +0200 Subject: [PATCH] Very little modification on User class to merge it in a new branch --- MCTG/Model/User/User.cs | 9 ++++++++- MCTG/Views/App.xaml.cs | 2 +- MCTG/Views/MyProfil.xaml | 5 +++-- MCTG/Views/Views.csproj | 4 ++++ 4 files changed, 16 insertions(+), 4 deletions(-) diff --git a/MCTG/Model/User/User.cs b/MCTG/Model/User/User.cs index 3c6bf73..cbec8c4 100644 --- a/MCTG/Model/User/User.cs +++ b/MCTG/Model/User/User.cs @@ -111,8 +111,15 @@ namespace Model set=> priorities = value; } - public bool Equals(User other) + public override bool Equals(object? obj) + { + if (obj == null) return false; + if (obj == this) return true; + return Equals(obj); + } + public bool Equals(User? other) { + if (other == null ) return false; return Name.Equals(other.Name) && Surname.Equals(other.Surname) && Mail.Equals(other.Mail); } diff --git a/MCTG/Views/App.xaml.cs b/MCTG/Views/App.xaml.cs index 6747bdf..304aed5 100644 --- a/MCTG/Views/App.xaml.cs +++ b/MCTG/Views/App.xaml.cs @@ -31,7 +31,7 @@ namespace Views /* - Comment(ctrl-k + ctrl-c)/Uncomment(ctrl-k + ctrl-u) to change page - */ UserAppTheme = AppTheme.Light; - MainPage = new RecipeReviews(); + MainPage = new MyProfil(); //MainPage = new MyPosts(); } } diff --git a/MCTG/Views/MyProfil.xaml b/MCTG/Views/MyProfil.xaml index e45e1ac..43c7c1d 100644 --- a/MCTG/Views/MyProfil.xaml +++ b/MCTG/Views/MyProfil.xaml @@ -2,6 +2,7 @@ @@ -23,12 +24,12 @@ - +