using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Pms.EventLibrary.TaskEventArgs;
using Pms.EventLibrary.TaskEvent;
using System.Windows.Forms;

namespace Pms.UserEvent.StepBookEvent
{
    /// <summary>
    /// 只是示例 可以删除
    /// </summary>
    public class Behavior_62122: BaseStepBookEvent
    {
        public Behavior_62122() : base(62122)
        {
        }

        /// <summary>
        /// 创建 步骤簿时 处理此行为码时触发
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected override void StepBookCreate(object sender, P_StepBookCreateEventArgs e)
        {
            //if (MessageBox.Show("是否创建成功！", "触发步骤创建事件", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning) != DialogResult.OK)
            //{
            //    e.IsSuccess = false;
            //}
            //else
            //{
            //    e.IsSuccess = true;
            //}
        }

        /// <summary>
        /// 步骤簿 开始执行时触发
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected override void StepBookStarted(object sender, P_StepBookExecuteEventArgs e)
        {
            //if (MessageBox.Show("是否开始成功！", "触发步骤开始事件", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning) != DialogResult.OK)
            //{
            //    e.IsSuccessed = false;
            //}
            //else
            //{
            //    e.IsSuccessed = true;
            //}
        }

        /// <summary>
        /// 步骤簿 执行中 触发
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected override void StepBookExecuting(object sender, P_StepBookExecuteEventArgs e)
        {
            //if (MessageBox.Show("是否执行成功！", "触发步骤执行中事件", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning) != DialogResult.OK)
            //{
            //    e.IsSuccessed = false;
            //}
            //else
            //{
            //    e.IsSuccessed = true;
            //}
        }

        /// <summary>
        /// 步骤簿 执行结束触发
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected override void StepBookEnd(object sender, P_StepBookExecuteEventArgs e)
        {
            //if (MessageBox.Show("是否结束成功！", "触发步骤结束事件", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning) != DialogResult.OK)
            //{
            //    e.IsSuccessed = false;
            //}
            //else
            //{
            //    e.IsSuccessed = true;
            //}
        }
    }
}
