|
namespace MementoPattern
{
/// <summary>
/// Memento to get/set the state of an Employee
/// </summary>
public class EmployeeMemento
{
private string _firstName;
private string _lastName;
private uint _id;
public EmployeeMemento(Employee emp)
{
_firstName = emp.FirstName;
_lastName = emp.LastName;
_id = emp.Id;
}
public EmployeeMemento(string firstName, string lastName, uint id)
{
_firstName = firstName;
_lastName = lastName;
_id = id;
}
public string FirstName
{
get
{
return _firstName;
}
set
{
_firstName = value;
}
}
public string LastName
{
get
{
return _lastName;
}
set
{
_lastName = value;
}
}
public uint Id
{
get
{
return _id;
}
set
{
_id = value;
}
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
I am a Microsoft .Net developer having experience in developing enterprise applications using technologies such as WPF, Winform. Always look towards making the life simple by developing GUI based applications.