Exemplo n.º 1
0
        static void Main(string[] args)
        {
            Resume resume = new Resume("张三", 22);

            resume.Works.Company  = "腾讯";
            resume.Works.WorkYear = 1;
            resume.Works.WorkDate = "1990";

            Resume resume2 = (Resume)resume.Clone();

            resume2.Age            = 24;
            resume2.Works.Company  = "华为";
            resume2.Works.WorkYear = 3;
            resume2.Works.WorkDate = "1992";

            Resume resume3 = (Resume)resume.Clone();

            resume3.Age            = 27;
            resume3.Works.Company  = "百度";
            resume3.Works.WorkYear = 5;
            resume3.Works.WorkDate = "1995";

            resume.Display();
            resume2.Display();
            resume3.Display();
            Console.Read();
        }
Exemplo n.º 2
0
        static void Main(string[] args)
        {
            Resume a = new Resume("大鸟");
            a.SetPersonalInfo(1, 30);
            a.SetWorkExperience("2000-2006", "XX公司");

            Resume b = (Resume)a.Clone();
            b.SetWorkExperience("2003-2005", "YY公司");

            Resume c = (Resume)a.Clone();
            c.SetPersonalInfo(2, 25);
            c.SetWorkExperience("2013-2016", "ZZ公司");

            a.Display();
            b.Display();
            c.Display();

            ResumeDepth a1 = new ResumeDepth("大鸟");
            a1.SetPersonalInfo(1, 30);
            a1.SetWorkExperience("2000-2006", "XX公司");

            ResumeDepth b1 = (ResumeDepth)a1.Clone();
            b1.SetWorkExperience("2003-2005", "YY公司");

            ResumeDepth c1 = (ResumeDepth)a1.Clone();
            c1.SetPersonalInfo(2, 25);
            c1.SetWorkExperience("2013-2016", "ZZ公司");

            a1.Display();
            b1.Display();
            c1.Display();

            Console.Read();
        }
Exemplo n.º 3
0
        static void Main(string[] args)
        {
            Resume a = new Resume("大鸟");

            a.SetPersonalInfo("男", "29");
            a.SetWorkExprience(new WorkExperience()
            {
                WorkDate = "1998-2000", Company = "xxx公司"
            });

            Resume b = a.Clone() as Resume;

            b.SetWorkExprience(new WorkExperience()
            {
                WorkDate = "1998-2006", Company = "yyy企业"
            });
            Resume c = a.Clone() as Resume;

            c.SetPersonalInfo("female", "28");

            a.Display();
            b.Display();
            c.Display();

            Console.ReadKey();
        }
Exemplo n.º 4
0
        static void Main(string[] args)
        {
            //原型模式
            ConcreatePrototype1 proto  = new ConcreatePrototype1("你好");
            ConcreatePrototype1 proto1 = proto.Clone() as ConcreatePrototype1;

            Console.WriteLine("原有对象{0},复制的对象{1}", proto.Id, proto1.Id);

            Resume re = new Resume("李伟波");

            re.setPersonalInfo("24", "男");
            re.setWorkExperience("2016-05-01", "腾讯科技");

            Resume re1 = re.Clone() as Resume;

            re1.setWorkExperience("2016-05-01", "阿里巴巴");
            re.Display();
            re1.Display();


            Resumeone re2 = new Resumeone("刘明");

            re2.setPersonalInfo("24", "男");
            re2.setWorkExperience("2016-05-01", "腾讯科技");

            Resumeone re3 = re2.Clone() as Resumeone;

            re3.setWorkExperience("2016-05-01", "阿里巴巴");
            re2.Display();
            re3.Display();
            Console.Read();
        }
Exemplo n.º 5
0
        static void Main(string[] args)
        {
            Resume a = new Resume("Jack");

            a.SetWorkExperience(18, "2020", "AA.INC");
            a.Display();

            Resume b = a.DeepCopy();

            b.SetCompany("BB.INC");
            b.Display();

            a.Display();

            Console.ReadLine();
        }
Exemplo n.º 6
0
        static void Main(string[] args)
        {
            Resume resumeA = new Resume("大鳥");

            resumeA.SetPersonlInfo("男", 29);
            resumeA.SetWorkExperience("1998-2000", "XX公司");

            Resume resumeB = (Resume)resumeA.Clone();

            resumeB.SetWorkExperience("1998-2006", "YY企業");

            Resume resumeC = (Resume)resumeA.Clone();

            resumeC.SetPersonlInfo("男", 24);
            resumeC.SetWorkExperience("1998-2003", "ZZ企業");

            resumeA.Display();
            resumeB.Display();
            resumeC.Display();

            Console.WriteLine("\n");

            ConcretePrototype1 prototype1 = new ConcretePrototype1("My name is YoChen");
            ConcretePrototype1 prototype2 = (ConcretePrototype1)prototype1.Clone();

            Console.WriteLine($"Clone: {prototype2.Id}");

            Console.ReadLine();
        }
Exemplo n.º 7
0
        static void Main(string[] args)
        {
            Resume rs1 = new Resume("HarKey");

            rs1.SetPersonalInfo("Boy", "26");
            rs1.SetWorkExperience("10/2017-12/2018", "3g");

            Resume rs2 = (Resume)rs1.Clone();

            rs2.SetWorkExperience("06/2016-08/2017", "Neware");

            rs1.Display();
            rs2.Display();
        }
Exemplo n.º 8
0
        static void Main(string[] args)
        {
            Resume a = new Resume("大鸟");
            a.SetPersonalInfo("男","29");
            a.SetWorkExperience("1998-2000", "XX公司");

            Resume b = (Resume)a.Clone();
            //b.SetWorkExperience("1998-2006", "YY企业");

            Resume c = (Resume)a.Clone();
            //c.SetWorkExperience("1998-2003", "ZZ企业");

            a.Display();
            b.Display();
            c.Display();

            Console.Read();
        }
Exemplo n.º 9
0
        static void Main(string[] args)
        {
            Resume a = new Resume("Ben");

            a.SetPersonalInfo("man", "30");
            a.SetWorkExperience("2016", "conmpany_a");
            a.Display();
            Resume b = (Resume)a.Clone();

            b.SetPersonalInfo("man", "30");
            b.SetWorkExperience("2017", "conmpany_b");
            b.Display();

            Resume c = (Resume)a.Clone();

            c.SetPersonalInfo("man", "30");
            c.SetWorkExperience("2018", "conmpany_c");
            c.Display();
        }
Exemplo n.º 10
0
        static void Main(string[] args)
        {
            Resume a = new Resume("Kuan");

            a.setPersonalInfo("男", "25");
            a.sexWorkExperience("2017-2018", "soft-world");

            Resume b = (Resume)a.Clone();

            b.sexWorkExperience("1998-2006", "YMCA");

            Resume c = (Resume)a.Clone();

            c.setPersonalInfo("男", "23");
            a.Display();
            b.Display();
            c.Display();
            Console.ReadKey();
        }
Exemplo n.º 11
0
        static void Main(string[] args)
        {
            Resume a = new Resume("大鸟");

            a.SetPersonalInfo("男", "29");
            a.SetWorkExperience("1998-2000", "xx公司");

            Resume b = (Resume)a.Clone();

            b.SetWorkExperience("1998-2006", "YY企业");

            Resume c = (Resume)a.Clone();

            c.SetPersonalInfo("男", "24");
            c.SetWorkExperience("1998-2003", "ZZ企业");

            a.Display();
            b.Display();
            c.Display();
        }
Exemplo n.º 12
0
        static void Main(string[] args)
        {
            Resume a = new Resume("大鸟");

            a.SetPersonalInfo(1, 30);
            a.SetWorkExperience("2000-2006", "XX公司");

            Resume b = (Resume)a.Clone();

            b.SetWorkExperience("2003-2005", "YY公司");

            Resume c = (Resume)a.Clone();

            c.SetPersonalInfo(2, 25);
            c.SetWorkExperience("2013-2016", "ZZ公司");

            a.Display();
            b.Display();
            c.Display();

            ResumeDepth a1 = new ResumeDepth("大鸟");

            a1.SetPersonalInfo(1, 30);
            a1.SetWorkExperience("2000-2006", "XX公司");

            ResumeDepth b1 = (ResumeDepth)a1.Clone();

            b1.SetWorkExperience("2003-2005", "YY公司");

            ResumeDepth c1 = (ResumeDepth)a1.Clone();

            c1.SetPersonalInfo(2, 25);
            c1.SetWorkExperience("2013-2016", "ZZ公司");

            a1.Display();
            b1.Display();
            c1.Display();


            Console.Read();
        }
Exemplo n.º 13
0
        public static void Main(string[] args)
        {
            var resume = new Resume("Bryan");

            resume.SetPersonalInfo("男", "28");
            resume.SetWorkExperience("1998-2000", "XX公司");

            var resume2 = (Resume)resume.Clone();

            resume2.SetWorkExperience("1998-2006", "YY公司");

            var resume3 = (Resume)resume.Clone();

            resume3.SetPersonalInfo("男", "25");

            resume.Display();
            resume2.Display();
            resume3.Display();

            Console.Read();
        }