Пример #1
0
        static void Main(string[] args)
        {
            AtomPlant ap      = new AtomPlant();
            State     romania = new State("Romania", ap);
            State     hungary = new State("Hungary", ap);

            ap.Operate();
        }
Пример #2
0
        static void Main(string[] args)
        {
            // event publisher
            AtomPlant ap = new AtomPlant();

            // Subscriber #1
            State romania = new State("Romania", ap);

            // Subscriber #2
            State hungary = new State("Hungary", ap);

            // Publisher starts
            ap.Operate();


            Console.ReadKey();
        }
Пример #3
0
 public State(string s, AtomPlant ap)
 {
     name               = s;
     this.ap            = ap;
     this.ap.Explosion += new EventHandler <MEventArgs>(ap_Explosion);
 }
Пример #4
0
 public State(string s, AtomPlant ap)
 {
     name               = s;
     this.ap            = ap;
     this.ap.Explosion += handleExplosionEvent;
 }