Example #1
0
        void ShowCollectInfo(int lblType, string info)
        {
            Label lbl = null;

            switch (lblType)
            {
            case 0: lbl = lbl_CountCapture; break;

            case 1: lbl = lbl_CountMatch; break;

            case 2: lbl = lbl_CountMatchExact; break;

            case 3: lbl = lbl_CountItemExist; break;

            case 4: lbl = lbl_CountItemProcessed; break;
            }

            if (lbl.InvokeRequired)
            {
                ShowCollectInfoCallback showInfoCallBack = new ShowCollectInfoCallback(ShowCollectInfo);
                this.Invoke(showInfoCallBack, new object[] { lblType, info });
            }
            else
            {
                lbl.Text = info;
            }
        }
Example #2
0
        public Form1()
        {
            InitializeComponent();

            ShowImageEvent       += new ShowImageCallback(ShowImage);
            ShowCollectInfoEvent += new ShowCollectInfoCallback(ShowCollectInfo);

            dataDirPath = ConfigurationManager.AppSettings["DataDirPath"];

            if (null == dataDirPath)
            {
                MessageBox.Show("程序配置文件中无法找到数据目录相关配置,请检查!");
                return;
            }

            if (dataDirPath.Equals("") || false == Directory.Exists(dataDirPath))
            {
                MessageBox.Show("未指明数据目录或目录不存在,请检查!");
                return;
            }
        }