static void Main(string[] args)
        {
            TranslationDelegate baseDelegate          = new TranslationDelegate(NativeMacedonian);
            TranslationDelegate enTranslationDelegate = new TranslationDelegate(EnglishTranslation);
            TranslationDelegate esTranslationDelegate = new TranslationDelegate(SpanishTranslation);
            TranslationDelegate deTranslationDelegate = new TranslationDelegate(GermanTranslation);
            TranslationDelegate poTranslationDelegate = new TranslationDelegate(PortugeseTranslation);

            //baseDelegate("Zdravo");
            //enTranslationDelegate("Zdravo");
            //esTranslationDelegate("Zdravo");
            //deTranslationDelegate("Zdravo");
            //poTranslationDelegate("Zdravo");

            //baseDelegate("Zdravo");

            // multicasting delegates
            baseDelegate += enTranslationDelegate;
            baseDelegate += esTranslationDelegate;
            baseDelegate += deTranslationDelegate;
            baseDelegate += poTranslationDelegate;

            baseDelegate -= deTranslationDelegate;

            baseDelegate("Zdravo");


            Console.ReadLine();
        }
Exemplo n.º 2
0
        static void Main(string[] args)
        {
            TranslationDelegate baseDelegate  = new TranslationDelegate(NativeMacedonian);
            TranslationDelegate enTranslation = new TranslationDelegate(EnglishTranslation);
            TranslationDelegate esTranslation = new TranslationDelegate(SpanishTranslation);
            TranslationDelegate deTranslation = new TranslationDelegate(GermanTranslation);

            //baseDelegate("Zdravo");
            //enTranslation("Zdravo");
            //esTranslation("Zdravo");
            //deTranslation("Zdravo");

            baseDelegate("Zdravo");

            baseDelegate += enTranslation;
            baseDelegate += esTranslation;
            baseDelegate += deTranslation;

            baseDelegate -= enTranslation;

            baseDelegate("Zdravo");
            Console.Read();
        }