using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Threading;

namespace BEMSDataGateway
{
    public partial class FirstCheck_Progressbar : Form
    {
        Thread th1;
        public FirstCheck_Progressbar()
        {
            InitializeComponent();
            this.label1.Text = (Form1.Enable_EnglishMode ? "\r\nPlease wait. (It will take about 1 minute)" : "\r\n잠시만 기다려주세요. (약 1분 소요 예정)");
            this.Text = (Form1.Enable_EnglishMode ? "Processing Database job" : "DATABASE 작업 처리 중 입니다.");
        }

        public void Start_progressBar()
        {
            th1 = new Thread(new ThreadStart(myThread));
            th1.Start();
        }

        private delegate void myDelegate(int theValue, int theMax);

        private void updateProgress(int theValue, int theMax)
        {
            Close();
        }

        public void Stop_progressBar()
        {
            this.Invoke(new myDelegate(updateProgress), new object[] { 100, 100 });
        }

        private void myThread()
        {
            ShowDialog();
            start_progressBar.Enabled = true;
        }
    }
}
