|
|
@ -10,6 +10,17 @@ namespace Model
|
|
|
|
[DataContract]
|
|
|
|
[DataContract]
|
|
|
|
public sealed class User : INotifyPropertyChanged , IEquatable<User>
|
|
|
|
public sealed class User : INotifyPropertyChanged , IEquatable<User>
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
[DataMember]
|
|
|
|
|
|
|
|
public string UserImage
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
get => userImage;
|
|
|
|
|
|
|
|
private set
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
if (!string.IsNullOrWhiteSpace(value)) userImage = value;
|
|
|
|
|
|
|
|
else userImage = "no_cover.png";
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
private string userImage = default!;
|
|
|
|
[DataMember]
|
|
|
|
[DataMember]
|
|
|
|
public string? Username
|
|
|
|
public string? Username
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -24,11 +35,11 @@ namespace Model
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
private string username;
|
|
|
|
private string username=default!;
|
|
|
|
[DataMember]
|
|
|
|
[DataMember]
|
|
|
|
public string Biographie
|
|
|
|
public string Biographie
|
|
|
|
{
|
|
|
|
{
|
|
|
|
get => biographie ?? "Pas de biographie";
|
|
|
|
get => biographie;
|
|
|
|
private set
|
|
|
|
private set
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (string.IsNullOrWhiteSpace(value)) biographie = "Pas de biographie";
|
|
|
|
if (string.IsNullOrWhiteSpace(value)) biographie = "Pas de biographie";
|
|
|
@ -39,7 +50,7 @@ namespace Model
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
private string biographie;
|
|
|
|
private string biographie = default!;
|
|
|
|
[DataMember]
|
|
|
|
[DataMember]
|
|
|
|
public string Email
|
|
|
|
public string Email
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -55,7 +66,7 @@ namespace Model
|
|
|
|
else email = "Default";
|
|
|
|
else email = "Default";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
private string email;
|
|
|
|
private string email = default!;
|
|
|
|
[DataMember]
|
|
|
|
[DataMember]
|
|
|
|
public string Password
|
|
|
|
public string Password
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -71,7 +82,7 @@ namespace Model
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
private string password;
|
|
|
|
private string password = default!;
|
|
|
|
|
|
|
|
|
|
|
|
public event PropertyChangedEventHandler? PropertyChanged;
|
|
|
|
public event PropertyChangedEventHandler? PropertyChanged;
|
|
|
|
|
|
|
|
|
|
|
@ -89,17 +100,6 @@ namespace Model
|
|
|
|
get;
|
|
|
|
get;
|
|
|
|
private init;
|
|
|
|
private init;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
[DataMember]
|
|
|
|
|
|
|
|
public string? UserImage
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
get => userImage;
|
|
|
|
|
|
|
|
private set
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
if (!string.IsNullOrWhiteSpace(value)) userImage = value;
|
|
|
|
|
|
|
|
else userImage = "no_cover.png";
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
private string? userImage;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public User(string userImage,string username, string biographie, string email, string password)
|
|
|
|
public User(string userImage,string username, string biographie, string email, string password)
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -111,7 +111,7 @@ namespace Model
|
|
|
|
else Biographie = biographie;
|
|
|
|
else Biographie = biographie;
|
|
|
|
if (email == null) Email = "Default";
|
|
|
|
if (email == null) Email = "Default";
|
|
|
|
else Email = email;
|
|
|
|
else Email = email;
|
|
|
|
if (password == null) throw new ArgumentNullException("password");
|
|
|
|
if (password == null) throw new ArgumentNullException(nameof(password));
|
|
|
|
else Password = password;
|
|
|
|
else Password = password;
|
|
|
|
Followed_Games = new ObservableCollection<Game>();
|
|
|
|
Followed_Games = new ObservableCollection<Game>();
|
|
|
|
}
|
|
|
|
}
|
|
|
|