Esempio n. 1
0
 private static void AddFormGrids(IPanelFactoryInfo onePanelInfo, IDictionary <string, IEditableGridControl> formGrids)
 {
     foreach (KeyValuePair <string, IEditableGridControl> keyValuePair in onePanelInfo.FormGrids)
     {
         formGrids.Add(keyValuePair);
     }
 }
Esempio n. 2
0
 private static void AddControlMappers(IPanelFactoryInfo onePanelInfo, ControlMapperCollection controlMappers)
 {
     foreach (ControlMapper controlMapper in onePanelInfo.ControlMappers)
     {
         controlMappers.Add(controlMapper);
     }
 }
Esempio n. 3
0
        /// <summary>
        /// Creates a panel to display a business object
        /// </summary>
        /// <returns>Returns the panel info object containing the panel</returns>
        public IPanelFactoryInfo CreatePanel()
        {
            IPanelFactoryInfo factoryInfo;

            _firstControl = null;
            if (_uiForm.Count > 1)
            {
                IPanel mainPanel = _controlFactory.CreatePanel(_controlFactory);
                ControlMapperCollection controlMappers = new ControlMapperCollection();
                IDictionary <string, IEditableGridControl> formGrids = new Dictionary <string, IEditableGridControl>();
                ITabControl         tabControl       = _controlFactory.CreateTabControl();
                BorderLayoutManager mainPanelManager = _controlFactory.CreateBorderLayoutManager(mainPanel);
                mainPanelManager.AddControl(tabControl, BorderLayoutManager.Position.Centre);
                foreach (UIFormTab formTab in _uiForm)
                {
                    IPanelFactoryInfo onePanelInfo = CreateOnePanel(formTab);
                    AddControlMappers(onePanelInfo, controlMappers);
                    AddFormGrids(onePanelInfo, formGrids);
                    ITabPage            page    = _controlFactory.CreateTabPage(formTab.Name);
                    BorderLayoutManager manager = _controlFactory.CreateBorderLayoutManager(page);
                    manager.AddControl(onePanelInfo.Panel, BorderLayoutManager.Position.Centre);
                    tabControl.TabPages.Add(page);
                }
                factoryInfo           = new PanelFactoryInfo(mainPanel, controlMappers, _uiDefName, _firstControl);
                factoryInfo.FormGrids = formGrids;
            }
            else
            {
                factoryInfo = CreateOnePanel(_uiForm[0]);
            }
            SetFormPreferredHeight(factoryInfo);
            //TODO_Port AttachTriggers(_uiForm, factoryInfo, _currentBusinessObject);
            return(factoryInfo);
        }
Esempio n. 4
0
 private void SetFormPreferredHeight(IPanelFactoryInfo factoryInfo)
 {
     if (_uiForm.Height > -1)
     {
         factoryInfo.PreferredHeight = _uiForm.Height;
     }
     if (_uiForm.Width > -1)
     {
         factoryInfo.PreferredWidth = _uiForm.Width;
     }
 }
Esempio n. 5
0
        /// <summary>
        /// Creates one panel for each UI Form definition of a business object
        /// </summary>
        /// <returns>Returns the list of panel info objects created</returns>
        public List <IPanelFactoryInfo> CreateOnePanelPerUIFormTab()
        {
            List <IPanelFactoryInfo> panelInfoList = new List <IPanelFactoryInfo>();

            foreach (UIFormTab formTab in _uiForm)
            {
                IPanelFactoryInfo onePanelInfo = CreateOnePanel(formTab);

                panelInfoList.Add(onePanelInfo);
            }
            return(panelInfoList);
        }
Esempio n. 6
0
 private void SetFormPreferredHeight(IPanelFactoryInfo factoryInfo)
 {
     if (_uiForm.Height > -1)
     {
         factoryInfo.PreferredHeight = _uiForm.Height;
     }
     if (_uiForm.Width > -1)
     {
         factoryInfo.PreferredWidth = _uiForm.Width;
     }
 }
Esempio n. 7
0
 private static void AddControlMappers(IPanelFactoryInfo onePanelInfo, ControlMapperCollection controlMappers)
 {
     foreach (ControlMapper controlMapper in onePanelInfo.ControlMappers)
     {
         controlMappers.Add(controlMapper);
     }
 }
Esempio n. 8
0
 private static void AddFormGrids(IPanelFactoryInfo onePanelInfo, IDictionary<string, IEditableGridControl> formGrids)
 {
     foreach (KeyValuePair<string, IEditableGridControl> keyValuePair in onePanelInfo.FormGrids)
     {
         formGrids.Add(keyValuePair);
     }
 }