Beispiel #1
0
 private void HandleConsultantLocationChanged(Consultant consultant, EventArgs args)
 {
     if (ConsultantLocationChanged != null)
     {
         ConsultantLocationChanged(consultant, args);
     }
     if (ConsultantChanged != null)
     {
         ConsultantChanged(consultant, args);
     }
 }
Beispiel #2
0
 private void HandleConsultantAvailabilityChanged(Consultant consultant, EventArgs args)
 {
     if (ConsultantAvailabilityChanged != null)
     {
         ConsultantAvailabilityChanged(consultant, args);
     }
     if (ConsultantChanged != null)
     {
         ConsultantChanged(consultant, args);
     }
 }
        public static void Test()
        {
            var consultantA = new Consultant();

            consultantA.LocationChanged     += OnLocationChanged;
            consultantA.AvailabilityChanged += OnAvailabilityChanged;
            consultantA.HandleMovement(new MsgMovement
            {
                Place = "Company"
            });
            consultantA.HandleMovement(new MsgMovement
            {
                Place = "Company1"
            });
        }
Beispiel #4
0
 public void Listen(Consultant subject)
 {
     subject.LocationChanged     += HandleConsultantLocationChanged;
     subject.AvailabilityChanged += HandleConsultantAvailabilityChanged;
 }