Esempio n. 1
0
        static void Main(string[] args)
        {
            Console.WriteLine("------------Customer--------------");
            Customer c1 = new Customer();

            c1.SetID(1);
            c1.SetName("Test testovski");
            Console.WriteLine("Name:{0}\nId:{1}", c1.GetName(), c1.GetId());

            Console.WriteLine("------------Customer with properties--------------");
            CustomerWithProperties c2 = new CustomerWithProperties();

            c2.ID   = 10;
            c2.Name = "Nekoj";
            Console.WriteLine("Name:{0}\nId:{1}", c2.Name, c2.ID);

            Console.WriteLine("------------Customer with properties read only--------------");
            CustomerWithPropertiesReadOnly c3 = new CustomerWithPropertiesReadOnly();

            c3.ID     = 10;
            c3.Name   = "Smotle";
            c3.secret = 5665;
            Console.WriteLine("Name:{0}\nId:{1}\nPin:{2}", c3.Name, c3.ID, c3.Pin);
            Console.ReadKey();
        }
Esempio n. 2
0
        static void Main(string[] args)
        {
            Console.WriteLine("------------Customer--------------");
            Customer c1 = new Customer();
            c1.SetID(1);
            c1.SetName("Test testovski");
            Console.WriteLine("Name:{0}\nId:{1}", c1.GetName(), c1.GetId());

            Console.WriteLine("------------Customer with properties--------------");
            CustomerWithProperties c2 = new CustomerWithProperties();
            c2.ID = 10;
            c2.Name ="Nekoj";
            Console.WriteLine("Name:{0}\nId:{1}", c2.Name, c2.ID);

            Console.WriteLine("------------Customer with properties read only--------------");
            CustomerWithPropertiesReadOnly c3 = new CustomerWithPropertiesReadOnly();
            c3.ID = 10;
            c3.Name = "Smotle";
            c3.secret  = 5665;
            Console.WriteLine("Name:{0}\nId:{1}\nPin:{2}", c3.Name, c3.ID,c3.Pin);
            Console.ReadKey();
        }