forked from WeihanLi/DesignPatterns
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSimpleResume.cs
More file actions
36 lines (30 loc) · 827 Bytes
/
SimpleResume.cs
File metadata and controls
36 lines (30 loc) · 827 Bytes
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
using System;
namespace PrototypePattern
{
/// <summary>
/// ShallowCopy
/// </summary>
internal class SimpleResume : ICloneable
{
private string _name;
private string _email;
private string _timePeriod;
private string _company;
public void SetPersonalInfo(string name, string email)
{
_name = name;
_email = email;
}
public void SetWorkExperience(string company, string timePeriod)
{
_company = company;
_timePeriod = timePeriod;
}
public void Display()
{
Console.WriteLine($"{_name} {_email}");
Console.WriteLine($"工作经历:{_timePeriod} {_company}");
}
public object Clone() => MemberwiseClone();
}
}