示例#1
0
        /// <summary>
        /// 获取右键菜单
        /// </summary>
        /// <returns></returns>
        public static ContextMenuStrip getTextRightMenu()
        {
            DataGridViewRightMenu dataGridViewRightMenu = new DataGridViewRightMenu();

            ControlCacheFactory.addSingletonCache(dataGridViewRightMenu.table_rightStrip);
            return(dataGridViewRightMenu.table_rightStrip);
        }
示例#2
0
        /// <summary>
        /// 获取右键菜单
        /// </summary>
        /// <returns></returns>
        public static MenuStrip getTopMenuStrip()
        {
            Control con = ControlCacheFactory.getSingletonCache(DefaultNameEnum.TOP_MENU);

            if (con == null)
            {
                TopMenuContainer topMenuContainer = new TopMenuContainer();
                ControlCacheFactory.addSingletonCache(topMenuContainer.topMenuStrip);
                return(topMenuContainer.topMenuStrip);
            }
            else
            {
                return((MenuStrip)con);
            }
        }
示例#3
0
        /// <summary>
        /// 获取单例的右键菜单
        /// </summary>
        /// <returns></returns>
        public static ContextMenuStrip getSingleTextRightMenu()
        {
            Control con = ControlCacheFactory.getSingletonCache(DefaultNameEnum.DATA_VIEW_RIGHT_MENU);

            if (con == null)
            {
                DataGridViewRightMenu dataGridViewRightMenu = new DataGridViewRightMenu();
                ControlCacheFactory.addSingletonCache(dataGridViewRightMenu.table_rightStrip);
                return(dataGridViewRightMenu.table_rightStrip);
            }
            else
            {
                return((ContextMenuStrip)con);
            }
        }
        /// <summary>
        /// 打开单例模式下的对象
        /// </summary>
        /// <param name="isShowTop">是否显示为顶层窗体</param>
        /// <returns></returns>
        public Control initSingleExample(bool isShowTop)
        {
            RedrawStatusBar conThis = null;
            Control         con     = ControlCacheFactory.getSingletonCache(DefaultNameEnum.TOOL_START);

            if (con == null || !(con is RedrawStatusBar))
            {
                conThis      = this;
                conThis.Name = EnumUtils.GetDescription(DefaultNameEnum.TOOL_START);
                ControlCacheFactory.addSingletonCache(conThis);
            }
            else
            {
                conThis = (RedrawStatusBar)con;
            }
            if (isShowTop)
            {
                conThis.BringToFront();
            }
            return(conThis);
        }
示例#5
0
        /// <summary>
        /// 打开单例模式下的对象
        /// </summary>
        /// <param name="isShowTop">是否显示为顶层窗体</param>
        /// <returns></returns>
        public Control initSingleExample(bool isShowTop)
        {
            ContextMenuStrip conThis = null;
            Control          con     = ControlCacheFactory.getSingletonCache(DefaultNameEnum.DATA_VIEW_RIGHT_MENU);

            if (con == null || !(con is ContextMenuStrip))
            {
                conThis      = table_rightStrip;
                conThis.Name = EnumUtils.GetDescription(DefaultNameEnum.DATA_VIEW_RIGHT_MENU);
                ControlCacheFactory.addSingletonCache(conThis);
            }
            else
            {
                conThis = (ContextMenuStrip)con;
            }
            if (isShowTop)
            {
                conThis.BringToFront();
            }
            return(conThis);
        }
        /// <summary>
        /// 打开单例模式下的添加字符窗口
        /// </summary>
        /// <param name="isShowTop">是否显示为顶层窗体</param>
        /// <returns></returns>
        public Control initSingleExample(bool isShowTop)
        {
            RedrawAddPageBut conThis = null;
            Control          con     = ControlCacheFactory.getSingletonCache(DefaultNameEnum.ADD_PAGE_BUTTON);

            if (con == null || !(con is RedrawAddPageBut))
            {
                conThis      = this;
                conThis.Name = EnumUtils.GetDescription(DefaultNameEnum.ADD_CHARS_FORM);
                ControlCacheFactory.addSingletonCache(conThis);
            }
            else
            {
                conThis = (RedrawAddPageBut)con;
            }
            if (isShowTop)
            {
                conThis.BringToFront();
            }
            return(conThis);
        }
示例#7
0
        /// <summary>
        /// 打开单例模式下的对象
        /// </summary>
        /// <param name="isShowTop">是否显示为顶层窗体</param>
        /// <returns></returns>
        public Control initSingleExample(bool isShowTop)
        {
            RedrawTextBox conThis = null;
            Control       con     = ControlCacheFactory.getSingletonCache(DefaultNameEnum.TEXTBOX_NAME_DEF);

            if (con == null || !(con is RedrawTextBox))
            {
                conThis      = this;
                conThis.Name = EnumUtils.GetDescription(DefaultNameEnum.TEXTBOX_NAME_DEF);
                ControlCacheFactory.addSingletonCache(conThis);
            }
            else
            {
                conThis = (RedrawTextBox)con;
            }
            if (isShowTop)
            {
                conThis.BringToFront();
            }
            return(conThis);
        }
示例#8
0
        /// <summary>
        /// 打开单例模式下的对象
        /// </summary>
        /// <param name="isShowTop">是否显示为顶层窗体</param>
        /// <returns></returns>
        public Control initSingleExample(bool isShowTop)
        {
            RedrawPromptMessBut conThis = null;
            Control             con     = ControlCacheFactory.getSingletonCache(DefaultNameEnum.PROMPT_MESSAGE);

            if (con == null || !(con is RedrawPromptMessBut))
            {
                conThis      = this;
                conThis.Name = EnumUtils.GetDescription(DefaultNameEnum.PROMPT_MESSAGE);
                ControlCacheFactory.addSingletonCache(conThis);
            }
            else
            {
                conThis = (RedrawPromptMessBut)con;
            }

            if (isShowTop)
            {
                conThis.BringToFront();
            }
            return(conThis);
        }
        /// <summary>
        /// 打开单例模式下的对象
        /// </summary>
        /// <param name="isShowTop">是否显示为顶层窗体</param>
        /// <returns></returns>
        public Control initSingleExample(bool isShowTop)
        {
            DataGridView conThis = null;
            Control      con     = ControlCacheFactory.getSingletonCache(DefaultNameEnum.DATA_GRID_VIEW_REDRAW);

            if (con == null || !(con is DataGridView))
            {
                conThis      = this;
                conThis.Name = EnumUtils.GetDescription(DefaultNameEnum.DATA_GRID_VIEW_REDRAW);
                ControlCacheFactory.addSingletonCache(conThis);
            }
            else
            {
                conThis = (DataGridView)con;
            }

            if (isShowTop)
            {
                conThis.BringToFront();
            }
            return(conThis);
        }
        // 主容器默认配置
        internal void initContainerDefConfig()
        {
            ToolStripContainer stripContainer = null;
            Control            con            = ControlCacheFactory.getSingletonCache(DefaultNameEnum.MAIN_CONTAINER);

            if (con == null)
            {
                stripContainer        = this;
                stripContainer.Name   = EnumUtils.GetDescription(DefaultNameEnum.MAIN_CONTAINER);
                stripContainer.Anchor = AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Top | AnchorStyles.Bottom;
                stripContainer.Dock   = DockStyle.None;
                // 设置不被焦点选中
                stripContainer.TabStop = false;
                // 容器的大小
                stripContainer.Size     = new Size(1, 1);
                stripContainer.Location = new Point(1, 1);
                ControlCacheFactory.addSingletonCache(stripContainer);
            }
            else
            {
                stripContainer = (ToolStripContainer)con;
            }
        }