Пример #1
0
        public static void Run()
        {
            {
                Model   m = new Model();
                Display d = new Display();
                Display e = new Display();
                Overloads.Register <ObserverPatternModelDisplay, Model, Display>(m, d);
                Overloads.Register <ObserverPatternModelDisplay, Model, Display>(m, e);
                Overloads.Notify <ObserverPatternModelDisplay, Model, Display>(m);
            }


            {
                Model   m = new Model();
                Display d = new Display();
                Display e = new Display();
                Overloads.Register <ObserverPatternModelDisplay2, Model, Display>(m, d);
                Overloads.Register <ObserverPatternModelDisplay2, Model, Display>(m, e);
                Overloads.Notify <ObserverPatternModelDisplay2, Model, Display>(m);
            }
        }
Пример #2
0
 public void Register(Model m, Display s)
 {
     System.Console.WriteLine("Register from OPMD2");
     Overloads.DefaultRegister <ObserverPatternModelDisplay, Model, Display>(m, s);
 }
Пример #3
0
 void ObserverPattern <Model, Display> .Notify(Model m)
 {
     Overloads.DefaultNotify <ObserverPatternModelDisplay, Model, Display>(m);
 }
Пример #4
0
 void ObserverPattern <Model, Display> .Register(Model m, Display s)
 {
     Overloads.DefaultRegister <ObserverPatternModelDisplay, Model, Display>(m, s);
 }
Пример #5
0
 public void Notify(Model m)
 {
     System.Console.WriteLine("Notify from OPMD2");
     Overloads.DefaultNotify <ObserverPatternModelDisplay, Model, Display>(m);
 }