static void Main()
        {
            // Create two instances and clone each
            Prototype1 prototype1 = new Prototype1("John", "Mayer");
            Prototype1 prototype1clone = (Prototype1)prototype1.Clone();
            Console.WriteLine("Cloned: {0}  {1}", prototype1clone.First_name, prototype1clone.Last_name);

            Prototype2 prototype2 = new Prototype2("Norah", "Jones");
            Prototype2 prototype2clone = (Prototype2)prototype2.Clone();
            Console.WriteLine("Cloned: {0}  {1}", prototype2clone.First_name, prototype2clone.Last_name);
        }
Example #2
0
        static void Main(string[] args)
        {
            Prototype1 P1 = new Prototype1(1);
            Prototype P = P1.Clone();
            Console.WriteLine("Cloned: {0}", P.Id);

            Prototype2 P2 = new Prototype2(2);
            P = P2.Clone();
            Console.WriteLine("Cloned: {0}", P.Id);

            Console.ReadKey();
        }
Example #3
0
        static void Main(string[] args)
        {
            Prototype1 P1 = new Prototype1(1);
            Prototype  P  = P1.Clone();

            Console.WriteLine("Cloned: {0}", P.Id);

            Prototype2 P2 = new Prototype2(2);

            P = P2.Clone();
            Console.WriteLine("Cloned: {0}", P.Id);

            Console.ReadKey();
        }