using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using  Project.StateMachine;

namespace Project
{
    public partial class fMain
    {
        /// <summary>
        /// 프로그램을 닫을때 1회 실행되는 함수
        /// File : /Step/_Step_Close.cs
        /// </summary>
        private void _STEP_CLOSING_START(eSMStep step)
        {
            PUB.bShutdown = true;
         
            PUB.AddEEDB("프로그램 종료");
            PUB.log.Add("Program Close");
            PUB.LogFlush();
        }
        public StepResult _STEP_CLOSING(eSMStep step, TimeSpan stepTime, TimeSpan seqTime)
        {
            //############################
            //####     사용자 전용 코드
            //############################
            

            //############################
            //####     개발자 권장코드
            //############################
            PUB.sm.SetNewStep(eSMStep.CLOSED);
            return StepResult.Complete;
        }

        public void _STEP_CLOSED_START(eSMStep step)
        {
            try
            {
                this.BeginInvoke(new Action(() =>
                {
                    //화면을 닫는다
                    PUB.sm.Stop();
                    this.Close();
                }));
            }
            catch { }
        }
        public StepResult _STEP_CLOSED(eSMStep step, TimeSpan stepTime, TimeSpan seqTime)
        {
            return StepResult.Wait;
        }
    }
}
