1 using System;
2
3 namespace Prototype
4 {
5 /// <summary>
6 /// 作者:bzyzhang
7 /// 时间:2016/5/24 19:36:45
8 /// 博客地址:http://www.cnblogs.com/bzyzhang/
9 /// Resume说明:本代码版权归bzyzhang所有,使用时必须带上bzyzhang博客地址
10 /// </summary>
11 public class Resume:ICloneable
12 {
13 private string name;
14 private string sex;
15 private string age;
16
17 private WorkExperience workExperience;
18
19 public Resume(string name)
20 {
21 this.name = name;
22 workExperience = new WorkExperience();
23 }
24
25 private Resume(WorkExperience work)
26 {
27 this.workExperience = (WorkExperience)work.Clone();
28 }
29
30 public void SetPersonalInfo(string sex,string age)
31 {
32 this.sex = sex;
33 this.age = age;
34 }
35
36 public void SetWorkExperience(string timeArea,string company)
37 {
38 workExperience.WorkData = timeArea;
39 workExperience.Company = company;
40 }
41
42 public void Display()
43 {
44 Console.WriteLine("{0}{1}{2}",name,sex,age);
45 Console.WriteLine("工作经历:{0}{1}", workExperience.WorkData, workExperience.Company);
46 }
47
48 public object Clone()
49 {
50 Resume obj = new Resume(this.workExperience);
51 obj.name = this.name;
52 obj.sex = this.sex;
53 obj.age = this.age;
54
55 return obj;
56 }
57 }
58 }