-
Notifications
You must be signed in to change notification settings - Fork 3
/
Person.cs
59 lines (51 loc) · 1.55 KB
/
Person.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
using System;
namespace DragAndDropRows {
public class Person {
string firstName;
string lastName;
string country;
public Person() { }
public Person(string firstName, string lastName, string country) {
this.firstName = firstName;
this.lastName = lastName;
this.country = country;
}
public string FirstName {
get { return firstName; }
set { firstName = value; }
}
public string LastName {
get { return lastName; }
set { lastName = value; }
}
public string Country {
get { return country; }
set { country = value; }
}
}
public class PersonEx : Person {
int id;
int parentID;
static int counter = 1;
public PersonEx() { }
public PersonEx(string firstName, string lastName, string country, int parentID)
: base(firstName, lastName, country) {
this.parentID = parentID;
id = counter++;
}
public PersonEx(Person person, int parentID)
: this(person.FirstName, person.LastName, person.Country, parentID) {
}
public int ID {
get { return id; }
set { id = value; }
}
public int ParentID {
get { return parentID; }
set { parentID = value; }
}
public Object[] ToArray() {
return new Object[] {ID, ParentID, FirstName, LastName, Country };
}
}
}