コード例 #1
0
        /// <summary>
        /// 根据函数名称实例化窗体
        /// </summary>
        public void InstanceWorkForm()
        {
            if (_functionName == "")
            {
                throw new Exception("引出函数名不能为空!");
            }
            frmYZZC frmYzzc = null;

            switch (_functionName)
            {
            case "Fun_ts_zyhs_yzzc":
                frmYzzc = new frmYZZC(_chineseName, 1);
                if (_mdiParent != null)
                {
                    frmYzzc.MdiParent = _mdiParent;
                }
                frmYzzc.Show();
                break;

            case "Fun_ts_zyhs_yzhd":
                frmYzzc = new frmYZZC(_chineseName, 3);
                if (_mdiParent != null)
                {
                    frmYzzc.MdiParent = _mdiParent;
                }
                frmYzzc.Show();
                break;

            case "Fun_ts_zyhs_yzcd":
                frmYzzc = new frmYZZC(_chineseName, 5);
                if (_mdiParent != null)
                {
                    frmYzzc.MdiParent = _mdiParent;
                }
                frmYzzc.Show();
                break;

            case "Fun_ts_zyhs_JyCodePrt":
                FrmLisCodePrt frmJy = new FrmLisCodePrt();
                if (_mdiParent != null)
                {
                    frmJy.MdiParent = _mdiParent;
                }
                frmJy.WindowState = FormWindowState.Maximized;
                frmJy.Show();
                break;

            default:
                throw new Exception("引出函数名称错误!");
            }
        }
コード例 #2
0
        public object GetObject()
        {
            if (_functionName == "")
            {
                throw new Exception("引出函数名不能为空!");
            }
            frmYZZC frmYzzc = null;

            switch (_functionName)
            {
            case "Fun_ts_zyhs_yzzc":
                frmYzzc = new frmYZZC(_chineseName, 1);
                if (_mdiParent != null)
                {
                    frmYzzc.MdiParent = _mdiParent;
                }
                frmYzzc.Show();
                break;

            case "Fun_ts_zyhs_yzhd":
                frmYzzc = new frmYZZC(_chineseName, 3);
                if (_mdiParent != null)
                {
                    frmYzzc.MdiParent = _mdiParent;
                }
                frmYzzc.Show();
                break;

            case "Fun_ts_zyhs_yzcd":
                frmYzzc = new frmYZZC(_chineseName, 5);
                if (_mdiParent != null)
                {
                    frmYzzc.MdiParent = _mdiParent;
                }
                frmYzzc.Show();
                break;

            default:
                throw new Exception("引出函数名称错误!");
            }
            return(frmYzzc);
        }