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

namespace parkspace_manager
{
    public partial class Form1 : Form
    {
        //Communicator com;
        FormParkSpaceStatus formParkSpaceStatus = null;
        public Form1()
        {
            InitializeComponent();
            formParkSpaceStatus = new FormParkSpaceStatus();
            //com = Communicator.Instance;
        }

        private void button1_Click(object sender, EventArgs e)
        {
            //com.Init();
            //com.Bind("tcp://192.168.2.144:20000");
            //com.Connect("tcp://192.168.2.125:20000");
        }

        private void button2_Click(object sender, EventArgs e)
        {
            //com.Uninit();
        }

        private void button3_Click(object sender, EventArgs e)
        {
            if (formParkSpaceStatus != null)
            {
                formParkSpaceStatus.Show();
            }
        }

        private void Form1_FormClosing(object sender, FormClosingEventArgs e)
        {
            formParkSpaceStatus.Uninit();
        }

        private void button1_MouseHover(object sender, EventArgs e)
        {
            Button btn = (Button)sender;
            // 创建the ToolTip 
            ToolTip toolTip1 = new ToolTip();

            // 设置显示样式
            toolTip1.AutoPopDelay = 5000;//提示信息的可见时间
            toolTip1.InitialDelay = 500;//事件触发多久后出现提示
            toolTip1.ReshowDelay = 500;//指针从一个控件移向另一个控件时，经过多久才会显示下一个提示框
            toolTip1.ShowAlways = true;//是否显示提示框

            //  设置伴随的对象.
            toolTip1.SetToolTip(btn, "开始？");//设置提示按钮和提示内容
        }
    }
}
