コード例 #1
0
ファイル: Form1.cs プロジェクト: BGCX261/zhuanlidm-svn-to-git
        public void TestThread()
        {
            try
            {
                f = new Func();
                f.SetDMPath(PicPath);
                Thread.Sleep(500);
                int pid = 0, handle = 0;
                if (this.txtPID.Text.Trim() != "")
                {
                    pid = int.Parse(txtPID.Text.Trim());
                }
                if (this.txtHandle.Text.Trim() != "")
                {
                    handle = int.Parse(txtHandle.Text.Trim());
                }
                f.BindDM(ClassName, pid, handle);
                f.Test();
                f.UnBindDM();
                this.Invoke(DelegateSetControl, new object[] { gbSetting, true });
                this.Invoke(DelegateSetControl, new object[] { gbStart, true });

            }
            catch (Exception ex)
            {
                this.Invoke(delegateShowMsg, new object[] { ex.Message });
                if (f != null)
                {
                    f.UnBindDM();
                    this.Invoke(DelegateSetControl, new object[] { gbSetting, true });
                    this.Invoke(DelegateSetControl, new object[] { gbStart, true });
                }
            }
        }