Beispiel #1
0
        /// <summary>
        /// Registers the xtra grid.
        /// </summary>
        /// <param name="editableService">The editable service.</param>
        /// <param name="control">The control.</param>
        /// <param name="register">if set to <c>true</c> [register].</param>
        private void RegisterXtraGridEditAdapter(IEditableService editableService, Control control, bool register)
        {
            Guard.ArgumentNotNull(editableService, "editableService");
            Guard.ArgumentNotNull(control, "control");

            foreach (Control ctrl in control.Controls)
            {
                if (ctrl is GridControl)
                {
                    if (register)
                    {
                        editableService.Register(ctrl);
                    }
                    else
                    {
                        editableService.UnRegister(ctrl);
                    }
                }

                if (ctrl.Controls.Count > 0)
                {
                    RegisterXtraGridEditAdapter(editableService, ctrl, register);
                }
            }
        }
Beispiel #2
0
        /// <summary>
        /// Registers the text edit.
        /// </summary>
        /// <param name="editableService">The editable service.</param>
        /// <param name="control">The control.</param>
        /// <param name="register">if set to <c>true</c> [register].</param>
        private void RegisterTextEdit(IEditableService editableService, Control control, bool register)
        {
            Guard.ArgumentNotNull(editableService, "editableService");
            Guard.ArgumentNotNull(control, "control");

            foreach (Control ctrl in control.Controls)
            {
                if (ctrl is TextEdit)
                {
                    if (register)
                    {
                        editableService.Register(ctrl);
                        ((TextEdit)ctrl).EnterMoveNextControl = true; // 设置可以通过Enter键将焦点移到下一控件
                    }
                    else
                    {
                        editableService.UnRegister(ctrl);
                    }
                }

                if (ctrl.Controls.Count > 0)
                {
                    RegisterTextEdit(editableService, ctrl, register);
                }
            }
        }
        /// <summary>
        /// Registers the xtra grid.
        /// </summary>
        /// <param name="editableService">The editable service.</param>
        /// <param name="control">The control.</param>
        /// <param name="register">if set to <c>true</c> [register].</param>
        private void RegisterXtraGridEditAdapter(IEditableService editableService, Control control, bool register)
        {
            Guard.ArgumentNotNull(editableService, "editableService");
            Guard.ArgumentNotNull(control, "control");

            foreach (Control ctrl in control.Controls) {
                if (ctrl is GridControl) {
                    if (register)
                        editableService.Register(ctrl);
                    else
                        editableService.UnRegister(ctrl);
                }

                if (ctrl.Controls.Count > 0)
                    RegisterXtraGridEditAdapter(editableService, ctrl, register);
            }
        }
        /// <summary>
        /// Registers the text edit.
        /// </summary>
        /// <param name="editableService">The editable service.</param>
        /// <param name="control">The control.</param>
        /// <param name="register">if set to <c>true</c> [register].</param>
        private void RegisterTextEdit(IEditableService editableService, Control control, bool register)
        {
            Guard.ArgumentNotNull(editableService, "editableService");
            Guard.ArgumentNotNull(control, "control");

            foreach (Control ctrl in control.Controls) {
                if (ctrl is TextEdit)
                {
                    if (register) {
                        editableService.Register(ctrl);
                        ((TextEdit)ctrl).EnterMoveNextControl = true; // 设置可以通过Enter键将焦点移到下一控件
                    }
                    else
                        editableService.UnRegister(ctrl);
                }

                if (ctrl.Controls.Count > 0)
                    RegisterTextEdit(editableService, ctrl, register);
            }
        }