eksam/Päevaküsimus/Models/Answer.cs

50 lines
1.1 KiB
C#
Raw Normal View History

2017-01-26 17:50:33 +02:00
using System;
using System.Collections;
namespace Päevaküsimus.Models
{
2017-01-26 19:32:16 +02:00
[Serializable()]
public class Answer : NotificationBase, ICloneable
2017-01-26 17:50:33 +02:00
{
2017-01-26 19:32:16 +02:00
private string _answer;
public string answer {
get { return _answer; }
set
{
_answer = value;
NotifyPropertyChanged();
}
}
2017-01-26 17:50:33 +02:00
public bool correct { get; set; }
2017-01-26 19:32:16 +02:00
private int _selectionCount;
public int selectionCount
{
get { return _selectionCount; }
set
{
_selectionCount = value;
NotifyPropertyChanged();
}
}
2017-01-26 17:50:33 +02:00
public Answer(string answer)
{
this.answer = answer;
this.correct = false;
}
public Answer(string answer, bool correct)
{
this.answer = answer;
this.correct = correct;
}
2017-01-26 19:32:16 +02:00
public object Clone()
{
var c = new Answer(answer.Clone() as string, correct);
c.selectionCount = selectionCount;
return c;
}
2017-01-26 17:50:33 +02:00
}
}