Пример #1
0
        public void AddTabPage(I_TabPageContainer view, string title, TabPageUISettingDTO groupUISettingDTO, bool skipTitle)
        {
            //LabelHelper.GenerateLabelControl(title, new ColumnUISettingDTO());
            var tabItem = (view as TabPageContainerManager).TabItem;

            if (!skipTitle)
            {
                var headerControl = new LabelControlManager(title, false);
                tabItem.Header = headerControl.WholeControl;
            }
            TabControl.Items.Add(tabItem);
        }
Пример #2
0
 public TabPageContainerManager(TabPageUISettingDTO tabpageUISettingDTO, int columnsCount) : base(columnsCount)
 {
     TabItem             = new TabItem();
     TabItem.Content     = ContentScrollViewer;
     TabPageUISettingDTO = tabpageUISettingDTO;
 }
Пример #3
0
        public void GenerateUIComposition(List <EntityUICompositionDTO> UICompositions, object container, UIControlPackageTree parentUIControlPackage, List <UIControlPackageTree> parentList)
        {
            //I_View_GridContainer container;
            //if (parentUIControlPackage == null)
            //{
            //    container = SpecializedDataView;
            //    parentList = UIControlPackageTree;
            //}
            //else
            //{
            //    parentList = parentUIControlPackage.ChildItems;
            //    container = parentUIControlPackage.Item as I_View_GridContainer;
            //}

            foreach (var uiCompositionItem in UICompositions.OrderBy(x => x.Position))
            {
                UIControlPackageTree item = new UIControlPackageTree();
                item.ParentItem = parentUIControlPackage;
                item.Container  = container;
                //if (parentUIControlPackage == null)
                //{
                //    item.UIComposition = uiCompositionItem;
                //    item.Container = DataView;

                //}+
                //if (uiCompositionItem.ObjectCategory == DatabaseObjectCategory.Entity)
                //{
                //    item.Item = DataView;
                //    parentList.Add(item);
                //    GenerateUIComposition(uiCompositionItem.ChildItems, DataView, item, item.ChildItems);

                //}
                if (uiCompositionItem.ObjectCategory == DatabaseObjectCategory.Group)
                {
                    var groupSetting = uiCompositionItem.GroupUISetting;
                    if (groupSetting == null)
                    {
                        groupSetting                      = new GroupUISettingDTO();
                        groupSetting.Expander             = true;
                        groupSetting.InternalColumnsCount = GetEntityUISetting().UIColumnsCount;
                        groupSetting.UIColumnsType        = Enum_UIColumnsType.Full;
                    }
                    var groupItem = AgentUICoreMediator.GetAgentUICoreMediator.UIManager.GenerateGroup(groupSetting);
                    item.Item   = groupItem;
                    item.UIItem = groupItem.UIMainControl;

                    groupItem.UIControlPackageTreeItem = item;
                    GenerateUIComposition(uiCompositionItem.ChildItems, groupItem, item, item.ChildItems);

                    if (item.ChildItems.Count != 0)
                    {
                        (container as I_View_GridContainer).AddGroup(groupItem, uiCompositionItem.Title, groupSetting);
                        parentList.Add(item);
                    }
                }
                else if (uiCompositionItem.ObjectCategory == DatabaseObjectCategory.TabControl)
                {
                    var tabgroupSetting = uiCompositionItem.TabGroupUISetting;
                    if (tabgroupSetting == null)
                    {
                        tabgroupSetting               = new TabGroupUISettingDTO();
                        tabgroupSetting.Expander      = true;
                        tabgroupSetting.UIColumnsType = Enum_UIColumnsType.Full;
                    }
                    var tabGroupContainer = AgentUICoreMediator.GetAgentUICoreMediator.UIManager.GenerateTabGroup(tabgroupSetting);
                    tabGroupContainer.UIControlPackageTreeItem = item;
                    item.Item   = tabGroupContainer;
                    item.UIItem = tabGroupContainer.UIMainControl;

                    GenerateUIComposition(uiCompositionItem.ChildItems, tabGroupContainer, item, item.ChildItems);
                    if (item.ChildItems.Count != 0)
                    {
                        (container as I_View_GridContainer).AddTabGroup(tabGroupContainer, uiCompositionItem.Title, tabgroupSetting);
                        parentList.Add(item);
                    }
                }
                else if (uiCompositionItem.ObjectCategory == DatabaseObjectCategory.TabPage)
                {
                    var tabpageSetting = uiCompositionItem.TabPageUISetting;
                    if (tabpageSetting == null)
                    {
                        tabpageSetting = new TabPageUISettingDTO();
                        tabpageSetting.InternalColumnsCount = GetEntityUISetting().UIColumnsCount;
                    }
                    var tabPage = AgentUICoreMediator.GetAgentUICoreMediator.UIManager.GenerateTabPage(tabpageSetting);
                    item.Item   = tabPage;
                    item.UIItem = tabPage.UIMainControl;
                    tabPage.UIControlPackageTreeItem = item;
                    GenerateUIComposition(uiCompositionItem.ChildItems, tabPage, item, item.ChildItems);
                    if (item.ChildItems.Count != 0)
                    {
                        var parentTabGroupContainer = parentUIControlPackage.Item as I_TabGroupContainer;
                        parentTabGroupContainer.AddTabPage(tabPage, uiCompositionItem.Title, tabpageSetting, tabPage.HasHeader);
                        parentList.Add(item);
                    }
                }
                else if (uiCompositionItem.ObjectCategory == DatabaseObjectCategory.Column)
                {
                    var columnControl = SimpleColumnControls.FirstOrDefault(x => x.Column.ID == Convert.ToInt32(uiCompositionItem.ObjectIdentity));
                    if (columnControl != null)
                    {
                        columnControl.UIControlPackageTreeItem = item;
                        item.Item   = columnControl.ControlManager;
                        item.UIItem = columnControl.ControlManager.GetUIControl(null);
                        (container as I_View_GridContainer).AddUIControlPackage(columnControl.SimpleControlManager, columnControl.ControlManager.LabelControlManager);
                        parentList.Add(item);
                        columnControl.Visited = true;
                    }
                }
                else if (uiCompositionItem.ObjectCategory == DatabaseObjectCategory.Relationship)
                {
                    var columnControl = RelationshipColumnControls.FirstOrDefault(x => x.Relationship != null && x.Relationship.ID == Convert.ToInt32(uiCompositionItem.ObjectIdentity));
                    if (columnControl != null)
                    {
                        columnControl.UIControlPackageTreeItem = item;
                        if (UICompositions.Count == 1 && parentUIControlPackage != null && parentUIControlPackage.Item is I_TabPageContainer)
                        {
                            (columnControl.ControlManager as I_RelationshipControlManager).TabPageContainer = parentUIControlPackage.Item as I_TabPageContainer;
                        }
                        item.Item   = columnControl.ControlManager;
                        item.UIItem = columnControl.ControlManager.GetUIControl(null);
                        (container as I_View_GridContainer).AddView(columnControl.ControlManager, columnControl.ControlManager.LabelControlManager);
                        parentList.Add(item);
                        columnControl.Visited = true;
                    }
                }
                else if (uiCompositionItem.ObjectCategory == DatabaseObjectCategory.EmptySpace)
                {
                    var setting = uiCompositionItem.EmptySpaceUISetting;
                    if (setting == null)
                    {
                        setting               = new EmptySpaceUISettingDTO();
                        setting.ExpandToEnd   = false;
                        setting.UIColumnsType = Enum_UIColumnsType.Normal;
                    }
                    //var emptyItem = SpecializedDataView.GenerateEmptySpace(setting);
                    //item.Item = emptyItem;
                    (container as I_View_GridContainer).AddEmptySpace(setting);
                    parentList.Add(item);
                }
                //حالت تب اضافه شود
                //uiControlPackageList.Add(item);
                //if (uiCompositionItem.ObjectCategory == DatabaseObjectCategory.Group)
                //{

                //}
            }
        }
Пример #4
0
 public I_TabPageContainer GenerateTabPage(TabPageUISettingDTO groupUISettingDTO)
 {
     return(new TabPageContainerManager(groupUISettingDTO, groupUISettingDTO.InternalColumnsCount));
 }