/// <summary>
        ///
        /// </summary>
        public static void RunEventSingleton()
        {
            // Если кот singleton
            _ = new Dog(true);
            _ = new Human(true);
            _ = new Mouse(true);

            CatSingleton.GetInstance().WakeUp();
        }
Ejemplo n.º 2
0
 public Mouse(bool bIsSingleton)
 {
     if (bIsSingleton)
     {
         CatSingleton.GetInstance().WakeUpEvent += Pui;
     }
     else
     {
         Cat              = new Cat("Алиса");
         Cat.WakeUpEvent += Pui;
     }
 }
Ejemplo n.º 3
0
 public Dog(bool bIsSingleton)
 {
     if (bIsSingleton)
     {
         CatSingleton.GetInstance().WakeUpEvent += Gav;
     }
     else
     {
         Cat              = new Cat("Мурзик");
         Cat.WakeUpEvent += Gav;
     }
 }
Ejemplo n.º 4
0
 public Human(bool bIsSingleton)
 {
     if (bIsSingleton)
     {
         CatSingleton.GetInstance().WakeUpEvent += Say;
     }
     else
     {
         Cat              = new Cat("Федор");
         Cat.WakeUpEvent += Say;
     }
 }
Ejemplo n.º 5
0
 public CatContext()
 {
     catSingleton = CatSingleton.GetInstance;
     rdm          = new Random();
 }