|
//
// MultiList library - Copyright 2008 by Michael Moorman / AsAbove.net
// This work is released to the public domain, and may be used for any purpose, without any conditions.
//
using System;
using System.Collections.Generic;
using System.Text;
namespace Test
{
public class Person : System.IEquatable<Person>
{
public enum Profession
{
Teacher,
Nurse,
Barber,
Welder,
Carpenter,
Lawyer
};
private string _name;
private int _age;
private Profession _career;
private static int _static_sequence = 0;
private int _sequence;
public Person (string name, int age, Profession career)
{
_name = name;
_age = age;
_career = career;
lock (typeof (Person))
{
_sequence = ++_static_sequence;
}
}
public string Name
{
get { return _name; }
}
public int Age
{
get { return _age; }
}
public Profession Career
{
get { return _career; }
}
public int Sequence
{
get { return _sequence; }
}
public bool Equals (Person p)
{
return Sequence == p.Sequence;
}
}
}
|
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.
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.