Advertisement
Guest User

Untitled

a guest
Jan 21st, 2019
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  1. using Core;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Linq;
  5. using System.ServiceModel;
  6. using System.Text;
  7. using System.Threading.Tasks;
  8.  
  9. namespace Alarm_Display
  10. {
  11. class Program
  12. {
  13. public class SubscriberCallBack : CoreReference.IAlarmCallback
  14. {
  15. public void AlarmHappened(Alarm a)
  16. {
  17. Console.WriteLine(a);
  18. }
  19. }
  20.  
  21. static void Main(string[] args)
  22. {
  23. Console.Write("Press ENTER to start reading: ");
  24. Console.ReadLine();
  25. InstanceContext ic = new InstanceContext(new SubscriberCallBack());
  26. CoreReference.AlarmClient proxy = new CoreReference.AlarmClient(ic);
  27. proxy.Subscribe();
  28. Console.ReadLine();
  29. proxy.Unsubscribe();
  30. }
  31. }
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement