PlaneRotateMapCommunication.cs 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using System.Windows.Controls;
  7. namespace HistoryDLL
  8. {
  9. public partial class PlaneRotateMap : UserControl
  10. {
  11. //外掛 Delegate event for communicate with LiveContainer (通知用) 判斷是否點擊
  12. public delegate void PlaneRotateMapBubbleToLiveContainer(int indexofevent, int indexofpicture);
  13. public event PlaneRotateMapBubbleToLiveContainer PlaneRotateMapBubbleToLiveContainerEvent;
  14. //通知該 LiveContainer 函數
  15. void SendInfoToLiveContainer(int indexofevent, int indexofpicture)
  16. {
  17. this.Dispatcher.BeginInvoke(PlaneRotateMapBubbleToLiveContainerEvent, indexofevent, indexofpicture);
  18. }
  19. //外掛 Delegate event for communicate with LiveContainer (通知用) 判斷是否撥放資料已經到底
  20. public delegate void PlaneRotateFileIsBlank(string ProcessCode, int BlockIndex);
  21. public event PlaneRotateFileIsBlank PlaneRotateFileIsBlankEvent;
  22. void SendChangeBlockIndex(string ProcessCode, int BlockIndex)
  23. {
  24. this.Dispatcher.BeginInvoke(PlaneRotateFileIsBlankEvent, ProcessCode, BlockIndex);
  25. }
  26. //從 LiveContainer 取得改變該區塊的狀態
  27. void ReceiveFromLiveContainerForFileChange(string ProcessCode, int blockIndex)
  28. {
  29. if (BlockIndex == blockIndex)
  30. {
  31. if (ProcessCode == "Cycle")
  32. {
  33. this.ChangeInfo = false;
  34. }
  35. else if (ProcessCode == "Change")
  36. {
  37. this.ChangeInfo = true;
  38. }
  39. else if (ProcessCode == "Finish")
  40. {
  41. this.ChangeInfo = false;
  42. sbStepTwo.Begin();
  43. }
  44. }
  45. }
  46. }
  47. }