Example #1
0
        private static IComponentInitMode <Control> getInitControlRelation(DefaultNameEnum name)
        {
            IComponentInitMode <Control> mode = null;

            if (DefaultNameEnum.ADD_PAGE_BUTTON.Equals(name))
            {
                mode = new RedrawAddPageBut();
            }
            else if (DefaultNameEnum.DATA_GRID_VIEW_REDRAW.Equals(name))
            {
                mode = new RedrawDataTable();
            }
            else if (DefaultNameEnum.MAIN_CONTAINER.Equals(name))
            {
                mode = new RedrawMainContainer();
            }
            else if (DefaultNameEnum.TAB_CONTENT.Equals(name))
            {
                mode = new RedrawTabControl();
            }
            else if (DefaultNameEnum.TAB_PAGE_NAME.Equals(name))
            {
                mode = new RedrawTabPage();
            }
            else if (DefaultNameEnum.TEXTBOX_NAME_DEF.Equals(name))
            {
                mode = new RedrawTextBox();
            }
            else if (DefaultNameEnum.TEXT_RIGHT_MENU.Equals(name))
            {
                mode = new TextRightMenu();
            }
            else if (DefaultNameEnum.DATA_VIEW_RIGHT_MENU.Equals(name))
            {
                mode = new DataGridViewRightMenu();
            }
            else if (DefaultNameEnum.TOOL_START.Equals(name))
            {
                mode = new RedrawStatusBar();
            }
            else if (DefaultNameEnum.PROMPT_MESSAGE.Equals(name))
            {
                mode = new RedrawPromptMessBut();
            }
            return(mode);
        }
Example #2
0
        /// <summary>
        /// 初始化数据表格配置
        /// </summary>
        private void initDataViewConf()
        {
            RedrawDataTable dataView = new RedrawDataTable();

            dataView.CellDefaultHeight       = cellDefHeight;
            dataView.ColumnHeadDefaultHeight = colHeadersHeight;
            dataView.Location = new Point(操作区容器.Location.X, 操作区容器.Bottom + 5);
            dataView.Size     = new Size(操作区容器.Width, 项区容器.Bottom - dataView.Location.Y);
            redrawDataTable   = dataView;
            // 记录到状态栏中
            Control c = UIComponentFactory.getSingleControl(DefaultNameEnum.TOOL_START);

            if (c != null && c is RedrawStatusBar)
            {
                RedrawStatusBar bar = (RedrawStatusBar)c;
                bar.SetSourceControl(dataView);
            }
            // 加入到容器中
            this.Controls.Add(redrawDataTable);
        }