Esempio n. 1
0
        /// <summary>
        ///调用打开助手窗口
        /// </summary>
        /// <param name="btnDTO">按钮参数</param>
        protected void LoadAssiFrame(AssiBtnDTO btnDTO)
        {
            if (!IsAllowOpenAssiFrameValidate(btnDTO))
            {
                if (assiViewFrame != null)
                {
                    assiViewFrame.Close();
                }
                return;
            }

            XBaseControl xBaseCtrl = this.getParentCtrl(btnDTO.FrameLocation);

            if (diAssiForm != null)
            {
                diAssiForm.Close();
                diAssiForm = null;
                isDiOpen   = false;
            }

            // 如果窗口已经打开,点击按钮时只进行tab页签间的切换
            if (assiViewFrame == null || (assiViewFrame.FrameLocation != btnDTO.FrameLocation || assiViewFrame.FrameOpenModel != btnDTO.OpenFrameModel) && assiViewFrame.IsFrameOpened)
            {
                if (assiViewFrame != null)
                {
                    assiViewFrame.Close();
                }

                assiViewFrame = new AssiViewFrame();
                assiViewFrame.assistantBtnBaseView = this;
                assiViewFrame.FrameLocation        = btnDTO.FrameLocation;
                assiViewFrame.FrameOpenModel       = btnDTO.OpenFrameModel;
                // 设置鼠标点击时,不需要关闭辅助录入的组件,除此之外都关闭辅助录入
                assiViewFrame.MouseInXBaseCtrlList = this.getMouseInXBaseCtrlList(btnDTO);

                //// 设置窗体的起始位置
                assiViewFrame.StartPosition   = FormStartPosition.Manual;
                assiViewFrame.FormBorderStyle = FormBorderStyle.None;

                assiViewFrame.Location = this.GetFrameLocation(xBaseCtrl);
                assiViewFrame.Size     = this.GetFrameSize(xBaseCtrl);
            }
            // 参数中增加事件处理对象
            Dictionary <string, object> paramDic = this.getParamDic(btnDTO);

            paramDic.Add("assiViewFrame", assiViewFrame);
            // 获取加载对象
            XUserControl xUserCtrl = this.LoadConfigUserControl(paramDic, btnDTO);

            if (xUserCtrl != null)
            {
                assiViewFrame.loadFrame(xBaseCtrl, xUserCtrl, btnDTO);
            }
        }
Esempio n. 2
0
 /// <summary>
 /// 弹出窗口关闭触发
 /// </summary>
 public void AssiViewFrameClosed()
 {
     this.assiViewFrame = null;
 }