Пример #1
0
        public void TemplateMethod(IPrimitives primitives)
        {
            var result = primitives.Operation1() +
                         primitives.Operation2();

            Console.WriteLine(result);
        }
Пример #2
0
 public void TemplateMethod(IPrimitives a)
 {
     var s =
         a.Operation1() +
             a.Operation2();
     Console.WriteLine(s);
 }
Пример #3
0
    public void TemplateMethod(IPrimitives a)
    {
        string s =
            a.Operation1() +
            a.Operation2();

        Console.WriteLine(s);
    }
Пример #4
0
 //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);
 }