Пример #1
0
        private static void ICloneable()
        {
            var john = new Person(new[] { "John", "Smith" }, new Address("London Road", 123));

            var jane = john.Clone() as Person;

            jane.Address.HouseNumber = 321;

            Console.WriteLine(john);
            Console.WriteLine(jane);
        }
Пример #2
0
 public Person(Person other)
 {
     Names   = other.Names;
     Address = new Address(other.Address);
 }