Modification de la classe Review

Popup_qui_marche_pas
Anthony RICHARD 2 years ago
parent 6e710a6fb1
commit 9655382818

@ -8,20 +8,43 @@ namespace Stim
{ {
internal class Review internal class Review
{ {
public float Rate { get; set; } public float Rate
public string Text { get; set; } {
get
{
return rate;
}
private set
{
if (value < 0 || value > 5) return;
rate = value;
}
}
private float rate;
public string Text
{
get
{
return text;
}
private set
{
if (text == "") return;
text = value;
}
}
private string text;
public Review(float rate, string text) public Review(float rate, string text)
{ {
CheckRate(rate); Rate = rate;
Text = text; Text = text;
} }
public bool CheckRate(float rate) public void EditReview(string text)
{ {
if (rate < 0 || rate > 5) return false; Text = text;
Rate=rate;
return true;
} }
} }
} }

Loading…
Cancel
Save