private void SetupGridAndBOEditorControlWin(IControlFactory controlFactory, IBOEditorControl iboEditorControl, string gridUiDefName)
        {
            if (controlFactory == null)
            {
                throw new ArgumentNullException("controlFactory");
            }
            if (iboEditorControl == null)
            {
                throw new ArgumentNullException("iboEditorControl");
            }

            _controlFactory   = controlFactory;
            _iboEditorControl = iboEditorControl;

            SetupReadOnlyGridControl(gridUiDefName);
            SetupButtonGroupControl();
            UpdateControlEnabledState();

            BorderLayoutManager layoutManager = _controlFactory.CreateBorderLayoutManager(this);

            layoutManager.AddControl(_readOnlyGridControl, BorderLayoutManager.Position.West);
            layoutManager.AddControl(_iboEditorControl, BorderLayoutManager.Position.Centre);
            layoutManager.AddControl(_buttonGroupControl, BorderLayoutManager.Position.South);

            _readOnlyGridControl.BusinessObjectSelected +=
                ((sender, e) => FireBusinessObjectSelected(e.BusinessObject));

            _readOnlyGridControl.Grid.SelectionChanged += GridSelectionChanged;
        }
        internal static IPanelInfo CreatePanelInfo
            (IControlFactory controlFactory, IClassDef classDef, string uiDefName, IBOEditorControl iboEditorControl)
        {
            IUIForm             uiForm        = GetUiForm(classDef, uiDefName);
            PanelBuilder        panelBuilder  = new PanelBuilder(controlFactory);
            IPanelInfo          panelInfo     = panelBuilder.BuildPanelForForm(uiForm);
            BorderLayoutManager layoutManager = controlFactory.CreateBorderLayoutManager(iboEditorControl);

            layoutManager.AddControl(panelInfo.Panel, BorderLayoutManager.Position.Centre);
            return(panelInfo);
        }
        private void SetupGridAndBOEditorControlVWG(IControlFactory controlFactory, IBOEditorControl iboEditorControl, IClassDef classDef, string gridUiDefName)
        {
            if (controlFactory == null)
            {
                throw new ArgumentNullException("controlFactory");
            }
            if (iboEditorControl == null)
            {
                throw new ArgumentNullException("iboEditorControl");
            }

            _controlFactory   = controlFactory;
            _iboEditorControl = iboEditorControl;

            IPanel panel = _controlFactory.CreatePanel();

            SetupReadOnlyGridControl(classDef, gridUiDefName);
            SetupButtonGroupControl();
            UpdateControlEnabledState();

            GridLayoutManager manager = new GridLayoutManager(panel, _controlFactory);

            manager.SetGridSize(2, 1);
            manager.FixAllRowsBasedOnContents();
            manager.AddControl(_iboEditorControl);
            manager.AddControl(_buttonGroupControl);

            this.FilterControl = _controlFactory.CreateGenericGridFilter(_readOnlyGridControl.Grid);

            BorderLayoutManager layoutManager = _controlFactory.CreateBorderLayoutManager(this);

            layoutManager.AddControl(this.FilterControl, BorderLayoutManager.Position.North);
            layoutManager.AddControl(_readOnlyGridControl, BorderLayoutManager.Position.West);
            layoutManager.AddControl(panel, BorderLayoutManager.Position.Centre);
            //layoutManager.AddControl(_selectButtonGroupControl, BorderLayoutManager.Position.South);

            _readOnlyGridControl.BusinessObjectSelected +=
                ((sender, e) => FireBusinessObjectSelected(e.BusinessObject));

            _readOnlyGridControl.Grid.SelectionChanged += GridSelectionChanged;
        }
        private void SetupGridAndBOEditorControlWin(IControlFactory controlFactory, IBOEditorControl iboEditorControl, string gridUiDefName)
        {
            if (controlFactory == null) throw new ArgumentNullException("controlFactory");
            if (iboEditorControl == null) throw new ArgumentNullException("iboEditorControl");

            _controlFactory = controlFactory;
            _iboEditorControl = iboEditorControl;

            SetupReadOnlyGridControl(gridUiDefName);
            SetupButtonGroupControl();
            UpdateControlEnabledState();

            BorderLayoutManager layoutManager = _controlFactory.CreateBorderLayoutManager(this);
            layoutManager.AddControl(_readOnlyGridControl, BorderLayoutManager.Position.West);
            layoutManager.AddControl(_iboEditorControl, BorderLayoutManager.Position.Centre);
            layoutManager.AddControl(_buttonGroupControl, BorderLayoutManager.Position.South);

            _readOnlyGridControl.BusinessObjectSelected +=
                ((sender, e) => FireBusinessObjectSelected(e.BusinessObject));

            _readOnlyGridControl.Grid.SelectionChanged += GridSelectionChanged;
        }
 ///<summary>
 /// Constructor for the <see cref="BOSelectorAndBOEditorControlWin"/>
 ///</summary>
 ///<param name="controlFactory"></param>
 ///<param name="iboEditorControl"></param>
 ///<param name="gridUiDefName"></param>
 public BOSelectorAndBOEditorControlWin(IControlFactory controlFactory, IBOEditorControl iboEditorControl, string gridUiDefName)
 {
     SetupGridAndBOEditorControlWin(controlFactory, iboEditorControl, gridUiDefName);
 }
 ///<summary>
 /// Constructor for the <see cref="BOSelectorAndBOEditorControlWin"/>
 ///</summary>
 ///<param name="controlFactory"></param>
 ///<param name="iboEditorControl"></param>
 public BOSelectorAndBOEditorControlWin(IControlFactory controlFactory, IBOEditorControl iboEditorControl)
     : this(controlFactory, iboEditorControl, "default")
 {
 }
 ///<summary>
 /// Constructor for the <see cref="BOGridAndEditorControlVWG"/>
 ///</summary>
 ///<param name="controlFactory"></param>
 ///<param name="iboEditorControl"></param>
 ///<param name="classDef"></param>
 ///<param name="gridUiDefName"></param>
 public BOGridAndEditorControlVWG(IControlFactory controlFactory, IBOEditorControl iboEditorControl, IClassDef classDef, string gridUiDefName)
 {
     SetupGridAndBOEditorControlVWG(controlFactory, iboEditorControl, classDef, gridUiDefName);
 }
 ///<summary>
 /// Constructor for the <see cref="BOGridAndEditorControlVWG"/>
 ///</summary>
 ///<param name="controlFactory"></param>
 ///<param name="iboEditorControl"></param>
 public BOGridAndEditorControlVWG(IControlFactory controlFactory, IBOEditorControl iboEditorControl)
     : this(controlFactory, iboEditorControl, null, "default")
 {
 }
 ///<summary>
 /// Constructor for the <see cref="BOSelectorAndBOEditorControlWin"/>
 ///</summary>
 ///<param name="controlFactory"></param>
 ///<param name="iboEditorControl"></param>
 ///<param name="gridUiDefName"></param>
 public BOSelectorAndBOEditorControlWin(IControlFactory controlFactory, IBOEditorControl iboEditorControl, string gridUiDefName)
 {
     SetupGridAndBOEditorControlWin(controlFactory, iboEditorControl, gridUiDefName);
 }
 ///<summary>
 /// Constructor for the <see cref="BOSelectorAndBOEditorControlWin"/>
 ///</summary>
 ///<param name="controlFactory"></param>
 ///<param name="iboEditorControl"></param>
 public BOSelectorAndBOEditorControlWin(IControlFactory controlFactory, IBOEditorControl iboEditorControl)
     : this(controlFactory, iboEditorControl, "default")
 {
 }
        private void SetupGridAndBOEditorControlWin(IControlFactory controlFactory, IBOEditorControl iboEditorControl, IClassDef classDef, string gridUiDefName)
        {
            if (controlFactory == null)
            {
                throw new ArgumentNullException("controlFactory");
            }
            if (iboEditorControl == null)
            {
                throw new ArgumentNullException("iboEditorControl");
            }
            _controlFactory   = controlFactory;
            _iboEditorControl = iboEditorControl;

            SetupReadOnlyGridControl(classDef, gridUiDefName);
            SetupButtonGroupControl();
            UpdateControlEnabledState();

            this.FilterControl = controlFactory.CreateGenericGridFilter(this.GridControl.Grid);
            this.FilterControl.FilterStarted   += (sender, e) => { this.SetFilteringUIState(true); };
            this.FilterControl.FilterCompleted += (sender, e) => { this.SetFilteringUIState(false); };

            var grid = new GridLayoutManager(this, _controlFactory);

            grid.SetGridSize(3, 4);
            grid.FixRow(2, _buttonGroupControl.Height);
            grid.FixRow(0, this.FilterControl.Height + 5);
            grid.FixColumn(0, this.FilterControl.Width);

            var leftMost   = this.Width;
            var rightMost  = 0;
            var bottomMost = 0;

            foreach (var control in this._iboEditorControl.Controls)
            {
                var ctl = control as Control;
                if (ctl == null)
                {
                    continue;
                }
                if (ctl.Left < leftMost)
                {
                    leftMost = ctl.Left;
                }
                if (ctl.Right > rightMost)
                {
                    rightMost = ctl.Right;
                }
                if (ctl.Bottom > bottomMost)
                {
                    bottomMost = ctl.Bottom;
                }
            }
            var editorWidth = rightMost - leftMost;

            grid.FixColumn(3, editorWidth);

            grid.AddControl(this.FilterControl, 1, 3);
            grid.AddControl(controlFactory.CreateControl());
            grid.AddControl(_readOnlyGridControl, 1, 3);
            grid.AddControl(_iboEditorControl);
            grid.AddControl(_buttonGroupControl, 1, 4);

            this.MinimumSize = new Size(editorWidth, bottomMost);

            _readOnlyGridControl.BusinessObjectSelected +=
                ((sender, e) => FireBusinessObjectSelected(e.BusinessObject));

            _readOnlyGridControl.Grid.SelectionChanged += GridSelectionChanged;
        }
 internal static IPanelInfo CreatePanelInfo
     (IControlFactory controlFactory, IClassDef classDef, string uiDefName, IBOEditorControl iboEditorControl)
 {
     IUIForm uiForm = GetUiForm(classDef, uiDefName);
     PanelBuilder panelBuilder = new PanelBuilder(controlFactory);
     IPanelInfo panelInfo = panelBuilder.BuildPanelForForm(uiForm);
     BorderLayoutManager layoutManager = controlFactory.CreateBorderLayoutManager(iboEditorControl);
     layoutManager.AddControl(panelInfo.Panel, BorderLayoutManager.Position.Centre);
     return panelInfo;
 }