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.
57 lines
1.4 KiB
57 lines
1.4 KiB
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Runtime.Serialization;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace Model.Classes
|
|
{
|
|
[DataContract(Name = "objetohara")]
|
|
public class ObjetOhara
|
|
{
|
|
[DataMember(Name = "nom")]
|
|
public string Nom { get; set; }
|
|
|
|
[DataMember(Name = "image")]
|
|
public string? Image { get; set; }
|
|
|
|
[DataMember(Name = "estfavori")]
|
|
public bool EstFavori { get; set; }
|
|
|
|
public ObjetOhara(string nom, string image = "baseimage.png", bool estFavori = false)
|
|
{
|
|
Nom = nom;
|
|
Image = image;
|
|
EstFavori = estFavori;
|
|
}
|
|
|
|
public override bool Equals(object? obj)
|
|
{
|
|
if (obj == null) return false;
|
|
if (this.GetType() != obj.GetType())
|
|
{
|
|
return false;
|
|
}
|
|
else
|
|
{
|
|
ObjetOhara o = (ObjetOhara)obj;
|
|
return o.Nom == Nom;
|
|
}
|
|
|
|
}
|
|
|
|
public override int GetHashCode()
|
|
{
|
|
|
|
return HashCode.Combine(Nom, Image,EstFavori);
|
|
}
|
|
public override string ToString()
|
|
{
|
|
return "ObjetOhara :" + Nom + " " +EstFavori+ " " + Image;
|
|
}
|
|
}
|
|
}
|
|
|
|
|