Beispiel #1
0
        public void TemplateMethod(IPrimitives primitives)
        {
            var result = primitives.Operation1() +
                         primitives.Operation2();

            Console.WriteLine(result);
        }
 public void TemplateMethod(IPrimitives a)
 {
     var s =
         a.Operation1() +
             a.Operation2();
     Console.WriteLine(s);
 }
Beispiel #3
0
    public void TemplateMethod(IPrimitives a)
    {
        string s =
            a.Operation1() +
            a.Operation2();

        Console.WriteLine(s);
    }
 //prima objekt tipa sucelja
 public void TemplateMethod(IPrimitives a)
 {
     //mora znati pozvati metode Operation1() i Operation2() nad objektom tipa sucelja(a), ali ne mora znati za koju tocno klasu!!!!
     string s = a.Operation1() + " " + a.Operation2();
     Console.WriteLine(s);
 }