using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Controls;

namespace HistoryDLL
{
    public partial class PlaneRotateMap : UserControl
    {
        //外掛 Delegate event for communicate with LiveContainer (通知用) 判斷是否點擊
        public delegate void PlaneRotateMapBubbleToLiveContainer(int indexofevent, int indexofpicture);
        public event PlaneRotateMapBubbleToLiveContainer PlaneRotateMapBubbleToLiveContainerEvent;

        //通知該 LiveContainer 函數
        void SendInfoToLiveContainer(int indexofevent, int indexofpicture)
        {
            this.Dispatcher.BeginInvoke(PlaneRotateMapBubbleToLiveContainerEvent, indexofevent, indexofpicture);
        }

        //外掛 Delegate event for communicate with LiveContainer (通知用) 判斷是否撥放資料已經到底
        public delegate void PlaneRotateFileIsBlank(string ProcessCode, int BlockIndex);
        public event PlaneRotateFileIsBlank PlaneRotateFileIsBlankEvent;

        void SendChangeBlockIndex(string ProcessCode, int BlockIndex)
        {
            this.Dispatcher.BeginInvoke(PlaneRotateFileIsBlankEvent, ProcessCode, BlockIndex);
        }

        //從 LiveContainer 取得改變該區塊的狀態
        void ReceiveFromLiveContainerForFileChange(string ProcessCode, int blockIndex)
        {
            if (BlockIndex == blockIndex)
            {
                if (ProcessCode == "Cycle")
                {
                    this.ChangeInfo = false;
                }
                else if (ProcessCode == "Change")
                {
                    this.ChangeInfo = true;
                }
                else if (ProcessCode == "Finish")
                {
                    this.ChangeInfo = false;

                    sbStepTwo.Begin();
                }
            }
        }

    }
}
