Exemplo n.º 1
0
        private void AddApplicationMenu()
        {
            ApplicationMenu menu = ComponentManager.ApplicationMenu;

            if (menu != null && menu.MenuContent != null)
            {
                // Create our Application Menu Item
                ApplicationMenuItem mi = new ApplicationMenuItem();
                mi.Text        = appText;
                mi.Description = appDesc;
                mi.LargeImage  = GetIcon(largeFile);
                // Attach the handler to fire out command
                mi.CommandHandler = new AutoCADCommandHandler(bpCmd);
                // Add it to the menu content
                menu.MenuContent.Items.Add(mi);
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Initialisation des sous menus
        /// </summary>
        protected override void initChildren()
        {
            this.Code   = FunctionalitiesCode.TRANSFORMATION_DATA;
            this.Header = FunctionalitiesLabel.TRANSFORMATION_LABEL;

            TransformationTreeMenu     = BuildMenu(FunctionalitiesCode.TRANSFORMATION_DATA, FunctionalitiesLabel.TRANSFORMATION_TREE_LABEL, FunctionalitiesCode.TRANSFORMATION_TREE);
            NewTransformationTreeMenu  = BuildMenu(FunctionalitiesCode.TRANSFORMATION_TREE, FunctionalitiesLabel.NEW_TRANSFORMATION_TREE_LABEL, NavigationToken.GetCreateViewToken(PlanificationFunctionalitiesCode.TRANSFORMATION_TREE_EDIT), Kernel.Domain.RightType.CREATE);
            ListTransformationTreeMenu = BuildMenu(FunctionalitiesCode.TRANSFORMATION_TREE, FunctionalitiesLabel.LIST_TRANSFORMATION_TREE_LABEL, NavigationToken.GetSearchViewToken(PlanificationFunctionalitiesCode.TRANSFORMATION_TREE_LIST), Kernel.Domain.RightType.VIEW);
            TransformationTreeMenu.Items.Add(NewTransformationTreeMenu);
            TransformationTreeMenu.Items.Add(ListTransformationTreeMenu);

            CombinedTransformationTreesMenu       = BuildMenu(FunctionalitiesCode.TRANSFORMATION_DATA, FunctionalitiesLabel.COMBINED_TRANSFORMATION_TREES_LABEL, FunctionalitiesCode.COMBINED_TRANSFORMATION_TREES);
            CreateCombinedTransformationTreesMenu = BuildMenu(FunctionalitiesCode.COMBINED_TRANSFORMATION_TREES, FunctionalitiesLabel.NEW_COMBINED_TRANSFORMATION_TREES_LABEL, NavigationToken.GetCreateViewToken(PlanificationFunctionalitiesCode.COMBINED_TRANSFORMATION_TREES_EDIT), Kernel.Domain.RightType.CREATE);
            ListCombinedTransformationTreesMenu   = BuildMenu(FunctionalitiesCode.COMBINED_TRANSFORMATION_TREES, FunctionalitiesLabel.LIST_COMBINED_TRANSFORMATION_TREES_LABEL, NavigationToken.GetSearchViewToken(PlanificationFunctionalitiesCode.COMBINED_TRANSFORMATION_TREES_LIST), Kernel.Domain.RightType.VIEW);
            CombinedTransformationTreesMenu.Items.Add(CreateCombinedTransformationTreesMenu);
            CombinedTransformationTreesMenu.Items.Add(ListCombinedTransformationTreesMenu);
        }
        public async Task <IActionResult> OnPostAsync(string id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            ApplicationMenu = await _context.ApplicationMenus.FindAsync(id);

            if (ApplicationMenu != null)
            {
                _context.ApplicationMenus.Remove(ApplicationMenu);
                await _context.SaveChangesAsync();
            }

            return(RedirectToPage("./ApplicationMenusIndex").WithSuccess("You are redirected!", string.Format("Menu: {0} with Id: {1} deleted.", ApplicationMenu.Name, ApplicationMenu.Id)));;
        }
        public void GenerateLink(ApplicationMenu.ApplicationType Type)
        {
            IDesignHelper.Menu.Clear();

            if (ApplicationMenu.DropdownEntries.ContainsKey(Type))
            {
                IDesignHelper.RegisterIMenuContainer(ApplicationMenu.DropdownEntries[Type]);
            }
            else
            {
                IDesignHelper.UnregisterIMenuContainer();
            }

            ApplicationMenu.TryGet(Type).ForEach((x) => {
                IDesignHelper.Menu.Add(x);
            });
        }
        private async Task IniMainMenu()
        {
            //_menuData = await HttpClient.GetFromJsonAsync<MenuDataItem[]>("data/menu.json");
            ApplicationMenu menu = await MenuManager.GetAsync(StandardMenus.Main);

            //_menuData = new MenuDataItem[1];
            //MenuDataItem item = new MenuDataItem();
            //item.Path = "/";
            //item.Name = "Dashboard";
            //item.Key = "dashboard";
            //item.Icon = "dashboard";
            //_menuData [0] = item;

            if (menu != null)
            {
                _menuData = GetMenuDataItems(menu.Items);
            }
        }
Exemplo n.º 6
0
        protected override async Task OnInitializedAsync()
        {
            Menu = await MenuManager.GetAsync(StandardMenus.User);

            Navigation.LocationChanged += OnLocationChanged;

            LazyGetService(ref AuthenticationStateProvider);
            LazyGetService(ref SignOutManager);

            if (AuthenticationStateProvider != null)
            {
                AuthenticationStateProvider.AuthenticationStateChanged += async(task) =>
                {
                    Menu = await MenuManager.GetAsync(StandardMenus.User);
                    await InvokeAsync(StateHasChanged);
                };
            }
        }
Exemplo n.º 7
0
        /// <summary>
        /// Initialisation des sous menus
        /// </summary>
        protected override void initChildren()
        {
            this.Code   = FunctionalitiesCode.ADMINISTRATION;
            this.Header = FunctionalitiesLabel.ADMINISTRATION_LABEL;

            UserMenu     = BuildMenu(FunctionalitiesCode.ADMINISTRATION, FunctionalitiesLabel.ADMINISTRATION_USER_LABEL, FunctionalitiesCode.ADMINISTRATION_USER);
            NewUserMenu  = BuildMenu(FunctionalitiesCode.ADMINISTRATION_USER, FunctionalitiesLabel.ADMINISTRATION_NEW_USER_LABEL, Kernel.Application.NavigationToken.GetCreateViewToken(AdministrationFunctionalitiesCode.ADMINISTRATION_USER_EDIT));
            ListUserMenu = BuildMenu(FunctionalitiesCode.ADMINISTRATION_USER, FunctionalitiesLabel.ADMINISTRATION_LIST_USER_LABEL, Kernel.Application.NavigationToken.GetSearchViewToken(AdministrationFunctionalitiesCode.ADMINISTRATION_USER_LIST));
            UserMenu.Items.Add(NewUserMenu);
            UserMenu.Items.Add(ListUserMenu);

            ProfilMenu     = BuildMenu(FunctionalitiesCode.ADMINISTRATION, FunctionalitiesLabel.ADMINISTRATION_PROFIL_LABEL, FunctionalitiesCode.ADMINISTRATION_PROFIL);
            NewProfilMenu  = BuildMenu(FunctionalitiesCode.ADMINISTRATION_PROFIL, FunctionalitiesLabel.ADMINISTRATION_NEW_PROFIL_LABEL, Kernel.Application.NavigationToken.GetCreateViewToken(AdministrationFunctionalitiesCode.ADMINISTRATION_PROFIL_EDIT));
            ListProfilMenu = BuildMenu(FunctionalitiesCode.ADMINISTRATION_PROFIL, FunctionalitiesLabel.ADMINISTRATION_LIST_PROFIL_LABEL, Kernel.Application.NavigationToken.GetSearchViewToken(AdministrationFunctionalitiesCode.ADMINISTRATION_PROFIL_LIST));
            ProfilMenu.Items.Add(NewProfilMenu);
            ProfilMenu.Items.Add(ListProfilMenu);

            RoleMenu = BuildMenu(FunctionalitiesCode.ADMINISTRATION, FunctionalitiesLabel.ADMINISTRATION_ROLE_LABEL, Kernel.Application.NavigationToken.GetCreateViewToken(AdministrationFunctionalitiesCode.ADMINISTRATION_ROLE));
        }
Exemplo n.º 8
0
 public MenuAndToolBarView(
     RibbonBarManager barManager,
     IButtonGroupToRibbonPageGroupMapper ribbonPageGroupMapper,
     IMenuBarItemToBarItemMapper barItemMapper,
     IRibbonBarItemToBarItemMapper ribbonItemMapper,
     ISkinManagerToSkinGalleryMapper skinGalleryMapper,
     ApplicationMenu applicationMenu,
     PanelControl panelRecentItems,
     IToolTipCreator toolTipCreator)
 {
     _barManager            = barManager;
     _ribbonPageGroupMapper = ribbonPageGroupMapper;
     _barItemMapper         = barItemMapper;
     _ribbonItemMapper      = ribbonItemMapper;
     _skinGalleryMapper     = skinGalleryMapper;
     _applicationMenu       = applicationMenu;
     _mruArrayList          = new MRUArrayList(_applicationMenu, panelRecentItems, toolTipCreator);
     _buttonGroupCache      = new Cache <string, IList <IButtonGroup> >(category => new List <IButtonGroup>());
 }
Exemplo n.º 9
0
        public async Task <MenuModel> AddMenu(MenuModel menuModel, RhNetContext context)
        {
            ApplicationMenu menu = new ApplicationMenu()
            {
                Header          = menuModel.Header,
                Path            = menuModel.Path,
                Permission_Name = menuModel.Permission_Name,
                Role_Name       = menuModel.Role_Name,
                Quick_Access    = menuModel.Quick_Access
            };

            context.Entry(menu).State = EntityState.Added;
            await context.SaveChangesAsync();

            await context.Entry(menu).ReloadAsync();

            menuModel.Id = menu.Id;

            return(menuModel);
        }
Exemplo n.º 10
0
        /// <summary>
        /// 作用:创建应用菜单
        /// 作者:汪建龙
        /// 编写时间:2016年12月20日15:11:35
        /// </summary>
        /// <param name="ribbonControl"></param>
        /// <param name="xmlDocment"></param>
        private void CreateApplicationMenu(RibbonControl ribbonControl, XmlDocument xmlDocment)
        {
            if (ribbonControl == null || xmlDocment == null)
            {
                return;
            }
            XmlNode node = xmlDocment.SelectSingleNode("/Workbench/RibbonControl/ApplicationMenu");

            if (node == null)
            {
                return;
            }

            string load = GetAttribute(node, "Load");

            if (string.IsNullOrEmpty(load) == false || load.ToUpper().IndexOf("F") > -1)
            {
                return;
            }
            XmlNodeList xmlNodeListPageItem = node.SelectNodes("MenuItem");

            if (xmlNodeListPageItem == null)
            {
                return;
            }

            ApplicationMenu applicationMenu1 = new ApplicationMenu();

            for (var i = 0; i < xmlNodeListPageItem.Count; i++)
            {
                XmlNode xmlNodePageItem = xmlNodeListPageItem.Item(i);
                BarItem item            = CreateItem(ribbonControl, xmlNodePageItem) as BarItem;
                if (item != null)
                {
                    applicationMenu1.ItemLinks.Add(item);
                    ribbonControl.Items.Add(item);
                }
            }
            applicationMenu1.Ribbon = ribbonControl;
            ribbonControl.ApplicationButtonDropDownControl = applicationMenu1;
        }
Exemplo n.º 11
0
        void ApplicationMenu_Opening(object sender, EventArgs e)
        {
            // Check to see if the custom menu item was added previously
            if (acApMenuItem == null)
            {
                // Get the application menu component
                ApplicationMenu acApMenu = ComponentManager.ApplicationMenu;

                // Create a new application menu item
                acApMenuItem                = new ApplicationMenuItem();
                acApMenuItem.Text           = "MyMenuItem";
                acApMenuItem.CommandHandler = new MyCommandHandler();

                // Append the new menu item
                acApMenu.MenuContent.Items.Add(acApMenuItem);

                // Remove the application menu Opening event handler
                ComponentManager.ApplicationMenu.Opening -=
                    new EventHandler <EventArgs>(ApplicationMenu_Opening);
            }
        }
Exemplo n.º 12
0
        /// <summary>
        /// Initialisation des sous menus
        /// </summary>
        protected override void initChildren()
        {
            this.Code   = FunctionalitiesCode.REPORTING;
            this.Header = FunctionalitiesLabel.REPORTING_LABEL;

            ReportGroupMenu = BuildMenu(FunctionalitiesCode.REPORTING, FunctionalitiesLabel.REPORT_LABEL, FunctionalitiesCode.REPORT);
            newReportMenu   = BuildMenu(FunctionalitiesCode.REPORT, FunctionalitiesLabel.NEW_REPORT_LABEL, NavigationToken.GetCreateViewToken(ReportingFunctionalitiesCode.REPORT_EDIT), Kernel.Domain.RightType.CREATE);
            listReportMenu  = BuildMenu(FunctionalitiesCode.REPORT, FunctionalitiesLabel.LIST_REPORT_LABEL, NavigationToken.GetSearchViewToken(ReportingFunctionalitiesCode.REPORT_LIST), Kernel.Domain.RightType.VIEW);

            StructuredReportGrouMenu = BuildMenu(FunctionalitiesCode.REPORTING, FunctionalitiesLabel.STRUCTURED_REPORT_LABEL, FunctionalitiesCode.STRUCTURED_REPORT);
            newStructuredReportMenu  = BuildMenu(FunctionalitiesCode.STRUCTURED_REPORT, FunctionalitiesLabel.NEW_STRUCTURED_REPORT_LABEL, NavigationToken.GetCreateViewToken(ReportingFunctionalitiesCode.STRUCTURED_REPORT_EDIT), Kernel.Domain.RightType.CREATE);
            listStructuredReportMenu = BuildMenu(FunctionalitiesCode.STRUCTURED_REPORT, FunctionalitiesLabel.LIST_STRUCTURED_REPORT_LABEL, NavigationToken.GetSearchViewToken(ReportingFunctionalitiesCode.STRUCTURED_REPORT_LIST), Kernel.Domain.RightType.VIEW);

            CalculatedMeasureGroupMenu = BuildMenu(FunctionalitiesCode.REPORTING, FunctionalitiesLabel.CALCULATED_MEASURE_LABEL, FunctionalitiesCode.CALCULATED_MEASURE);
            calculatedMeasureMenu      = BuildMenu(FunctionalitiesCode.CALCULATED_MEASURE, FunctionalitiesLabel.NEW_CALCULATED_MEASURE_LABEL, NavigationToken.GetCreateViewToken(ReportingFunctionalitiesCode.CALCULATED_MEASURE_EDIT), Kernel.Domain.RightType.CREATE);
            listCalculatedMeasureMenu  = BuildMenu(FunctionalitiesCode.CALCULATED_MEASURE, FunctionalitiesLabel.LIST_CALCULATED_MEASURE_LABEL, NavigationToken.GetSearchViewToken(ReportingFunctionalitiesCode.CALCULATED_MEASURE_LIST), Kernel.Domain.RightType.VIEW);

            PivotTableGroupMenu = BuildMenu(FunctionalitiesCode.REPORTING, FunctionalitiesLabel.PIVOT_TABLE_LABEL, FunctionalitiesCode.PIVOT_TABLE);
            newPivotTableMenu   = BuildMenu(FunctionalitiesCode.PIVOT_TABLE, FunctionalitiesLabel.NEW_PIVOT_TABLE_LABEL, NavigationToken.GetCreateViewToken(ReportingFunctionalitiesCode.PIVOT_TABLE_EDIT), Kernel.Domain.RightType.CREATE);
            listPivotTableMenu  = BuildMenu(FunctionalitiesCode.PIVOT_TABLE, FunctionalitiesLabel.LIST_PIVOT_TABLE_LABEL, NavigationToken.GetSearchViewToken(ReportingFunctionalitiesCode.PIVOT_TABLE_LIST), Kernel.Domain.RightType.VIEW);

            GridGroupMenu      = BuildMenu(FunctionalitiesCode.REPORTING, FunctionalitiesLabel.GRID_LABEL, FunctionalitiesCode.REPORT_GRID);
            NewReportGridMenu  = BuildMenu(FunctionalitiesCode.REPORT_GRID, FunctionalitiesLabel.NEW_REPORT_GRID_LABEL, NavigationToken.GetCreateViewToken(ReportingFunctionalitiesCode.REPORT_GRID_EDIT), Kernel.Domain.RightType.CREATE);
            ListReportGridMenu = BuildMenu(FunctionalitiesCode.REPORT_GRID, FunctionalitiesLabel.LIST_REPORT_GRID_LABEL, NavigationToken.GetSearchViewToken(ReportingFunctionalitiesCode.REPORT_GRID_LIST), Kernel.Domain.RightType.VIEW);

            ReportGroupMenu.Items.Add(NewReportMenu);
            ReportGroupMenu.Items.Add(ListReportMenu);

            GridGroupMenu.Items.Add(NewReportGridMenu);
            GridGroupMenu.Items.Add(ListReportGridMenu);

            StructuredReportGrouMenu.Items.Add(NewStructuredReportMenu);
            StructuredReportGrouMenu.Items.Add(ListStructuredReportMenu);

            CalculatedMeasureGroupMenu.Items.Add(calculatedMeasureMenu);
            CalculatedMeasureGroupMenu.Items.Add(listCalculatedMeasureMenu);

            PivotTableGroupMenu.Items.Add(newPivotTableMenu);
            PivotTableGroupMenu.Items.Add(listPivotTableMenu);
        }
Exemplo n.º 13
0
    protected virtual async Task <ApplicationMenu> GetInternalAsync(string name)
    {
        var menu = new ApplicationMenu(name);

        using (var scope = ServiceScopeFactory.CreateScope())
        {
            using (RequirePermissionsSimpleBatchStateChecker <ApplicationMenuItem> .Use(new RequirePermissionsSimpleBatchStateChecker <ApplicationMenuItem>()))
            {
                var context = new MenuConfigurationContext(menu, scope.ServiceProvider);

                foreach (var contributor in Options.MenuContributors)
                {
                    await contributor.ConfigureMenuAsync(context);
                }

                await CheckPermissionsAsync(scope.ServiceProvider, menu);
            }
        }

        NormalizeMenu(menu);

        return(menu);
    }
Exemplo n.º 14
0
        /// <summary>
        /// Initialisation des sous menus
        /// </summary>
        protected override void initChildren()
        {
            this.Code   = BfcFunctionalitiesCode.ADVISEMENT;
            this.Header = BfcFunctionalitiesLabel.ADVISEMENT_LABEL;
            PrefundingAdvisementMenu     = BuildMenu(BfcFunctionalitiesCode.ADVISEMENT, BfcFunctionalitiesLabel.PREFUNDING_ADVISEMENT_LABEL, BfcFunctionalitiesCode.ADVISEMENT);
            NewPrefundingAdvisementMenu  = BuildMenu(BfcFunctionalitiesCode.PREFUNDING_ADVISEMENT, BfcFunctionalitiesLabel.NEW_PREFUNDING_ADVISEMENT_LABEL, NavigationToken.GetCreateViewToken(BfcFunctionalitiesCode.PREFUNDING_ADVISEMENT), Kernel.Domain.RightType.CREATE);
            ListPrefundingAdvisementMenu = BuildMenu(BfcFunctionalitiesCode.PREFUNDING_ADVISEMENT, BfcFunctionalitiesLabel.LIST_PREFUNDING_ADVISEMENT_LABEL, NavigationToken.GetSearchViewToken(BfcFunctionalitiesCode.PREFUNDING_ADVISEMENT_LIST), Kernel.Domain.RightType.VIEW);
            PrefundingAdvisementMenu.Items.Add(NewPrefundingAdvisementMenu);
            PrefundingAdvisementMenu.Items.Add(ListPrefundingAdvisementMenu);

            MemberAdvisementMenu     = BuildMenu(BfcFunctionalitiesCode.ADVISEMENT, BfcFunctionalitiesLabel.MEMBER_ADVISEMENT_LABEL, BfcFunctionalitiesCode.ADVISEMENT);
            NewMemberAdvisementMenu  = BuildMenu(BfcFunctionalitiesCode.MEMBER_ADVISEMENT, BfcFunctionalitiesLabel.NEW_MEMBER_ADVISEMENT_LABEL, NavigationToken.GetCreateViewToken(BfcFunctionalitiesCode.MEMBER_ADVISEMENT), Kernel.Domain.RightType.CREATE);
            ListMemberAdvisementMenu = BuildMenu(BfcFunctionalitiesCode.MEMBER_ADVISEMENT, BfcFunctionalitiesLabel.LIST_MEMBER_ADVISEMENT_LABEL, NavigationToken.GetSearchViewToken(BfcFunctionalitiesCode.MEMBER_ADVISEMENT_LIST), Kernel.Domain.RightType.VIEW);
            MemberAdvisementMenu.Items.Add(NewMemberAdvisementMenu);
            MemberAdvisementMenu.Items.Add(ListMemberAdvisementMenu);

            ExceptionalAdvisementMenu     = BuildMenu(BfcFunctionalitiesCode.ADVISEMENT, BfcFunctionalitiesLabel.REPLENISHMENT_INSTRUCTION_ADVISEMENT_LABEL, BfcFunctionalitiesCode.ADVISEMENT);
            NewExceptionalAdvisementMenu  = BuildMenu(BfcFunctionalitiesCode.REPLENISHMENT_INSTRUCTION_ADVISEMENT, BfcFunctionalitiesLabel.NEW_REPLENISHMENT_INSTRUCTION_ADVISEMENT_LABEL, NavigationToken.GetCreateViewToken(BfcFunctionalitiesCode.REPLENISHMENT_INSTRUCTION_ADVISEMENT), Kernel.Domain.RightType.CREATE);
            ListExceptionalAdvisementMenu = BuildMenu(BfcFunctionalitiesCode.REPLENISHMENT_INSTRUCTION_ADVISEMENT, BfcFunctionalitiesLabel.LIST_REPLENISHMENT_INSTRUCTION_ADVISEMENT_LABEL, NavigationToken.GetSearchViewToken(BfcFunctionalitiesCode.REPLENISHMENT_INSTRUCTION_ADVISEMENT_LIST), Kernel.Domain.RightType.VIEW);
            ExceptionalAdvisementMenu.Items.Add(NewExceptionalAdvisementMenu);
            ExceptionalAdvisementMenu.Items.Add(ListExceptionalAdvisementMenu);

            SettlementAdvisementMenu     = BuildMenu(BfcFunctionalitiesCode.ADVISEMENT, BfcFunctionalitiesLabel.SETTLEMENT_ADVISEMENT_LABEL, BfcFunctionalitiesCode.ADVISEMENT);
            NewSettlementAdvisementMenu  = BuildMenu(BfcFunctionalitiesCode.SETTLEMENT_ADVISEMENT, BfcFunctionalitiesLabel.NEW_SETTLEMENT_ADVISEMENT_LABEL, NavigationToken.GetCreateViewToken(BfcFunctionalitiesCode.SETTLEMENT_ADVISEMENT), Kernel.Domain.RightType.CREATE);
            ListSettlementAdvisementMenu = BuildMenu(BfcFunctionalitiesCode.SETTLEMENT_ADVISEMENT, BfcFunctionalitiesLabel.LIST_SETTLEMENT_ADVISEMENT_LABEL, NavigationToken.GetSearchViewToken(BfcFunctionalitiesCode.SETTLEMENT_ADVISEMENT_LIST), Kernel.Domain.RightType.VIEW);
            SettlementAdvisementMenu.Items.Add(NewSettlementAdvisementMenu);
            SettlementAdvisementMenu.Items.Add(ListSettlementAdvisementMenu);

            ReviewMenu                    = BuildMenu(BfcFunctionalitiesCode.REVIEW, BfcFunctionalitiesLabel.REVIEW_LABEL, BfcFunctionalitiesCode.ADVISEMENT);
            ReviewPFAccountMenu           = BuildMenu(BfcFunctionalitiesCode.REVIEW, BfcFunctionalitiesLabel.REVIEW_PF_ACCOUNT_LABEL, NavigationToken.GetSearchViewToken(BfcFunctionalitiesCode.REVIEW_PF_ACCOUNT));
            ReviewSettlementEvolutionMenu = BuildMenu(BfcFunctionalitiesCode.REVIEW, BfcFunctionalitiesLabel.REVIEW_SETTLEMENT_EVOLUTION_LABEL, NavigationToken.GetSearchViewToken(BfcFunctionalitiesCode.REVIEW_SETTLEMENT_EVOLUTION));
            ReviewAgeingBalanceMenu       = BuildMenu(BfcFunctionalitiesCode.REVIEW, BfcFunctionalitiesLabel.REVIEW_AGEING_BALANCE_LABEL, NavigationToken.GetSearchViewToken(BfcFunctionalitiesCode.REVIEW_AGEING_BALANCE));
            ReviewMenu.Items.Add(ReviewPFAccountMenu);
            ReviewMenu.Items.Add(ReviewSettlementEvolutionMenu);
            ReviewMenu.Items.Add(ReviewAgeingBalanceMenu);
        }
Exemplo n.º 15
0
        public List <ApplicationMenu> GetMenuItems()
        {
            List <ApplicationMenu> menus    = new List <ApplicationMenu>();
            ApplicationMenu        homeMenu = new ApplicationMenu
            {
                MenuDescription = "Home Page",
                MenuId          = Guid.NewGuid(),
                MenuOrder       = 1,
                Module          = "Main"
            };

            ApplicationMenu aboutMenu = new ApplicationMenu
            {
                MenuDescription = "About Page",
                MenuId          = Guid.NewGuid(),
                MenuOrder       = 2,
                Module          = "Main"
            };

            menus.Add(homeMenu);
            menus.Add(aboutMenu);

            return(menus);
        }
Exemplo n.º 16
0
 public void Terminate()
 {
     ApplicationMenu.Detach();
 }
Exemplo n.º 17
0
        void SetMenuItemActivateCssClass(string pageUrl, ApplicationMenuItem menuItem = null, ApplicationMenu parentMenu = null)
        {
            ApplicationMenuItemList withItems = menuItem?.Items ?? parentMenu?.Items;

            withItems.ForEach(m =>
            {
                //TODO: Menu Url ~/ replace with / clear ~ character
                m.Url = m.Url != null ? m.Url.Replace("~/", "/") : m.Url;

                if (m.Url != null && string.Compare(pageUrl, $"{m.Url}/index", StringComparison.InvariantCultureIgnoreCase) == 0)
                {
                    m.CssClass = "active";

                    if (menuItem != null)
                    {
                        menuItem.CssClass = "active menu-open";
                    }
                }
                SetMenuItemActivateCssClass(pageUrl, m, parentMenu);
            });
        }
Exemplo n.º 18
0
        public IActionResult Init(string appName  = "", string areaName = "", string nodeName   = "",
                                  string pageName = "", Guid?recordId   = null, Guid?relationId = null, Guid?parentRecordId = null)
        {
            //Stopwatch sw = new Stopwatch();
            //sw.Start();

            if (String.IsNullOrWhiteSpace(appName))
            {
                appName = AppName;
            }
            if (String.IsNullOrWhiteSpace(areaName))
            {
                areaName = AreaName;
            }
            if (String.IsNullOrWhiteSpace(nodeName))
            {
                nodeName = NodeName;
            }
            if (String.IsNullOrWhiteSpace(pageName))
            {
                pageName = PageName;
            }
            if (recordId == null)
            {
                recordId = RecordId;
            }
            if (relationId == null)
            {
                relationId = RelationId;
            }
            if (parentRecordId == null)
            {
                parentRecordId = ParentRecordId;
            }

            var urlInfo = new PageService().GetInfoFromPath(HttpContext.Request.Path);

            if (String.IsNullOrWhiteSpace(appName))
            {
                appName = urlInfo.AppName;
                if (AppName != appName)
                {
                    AppName = appName;                     //When dealing with non standard routing in pages
                }
            }
            if (String.IsNullOrWhiteSpace(areaName))
            {
                areaName = urlInfo.AreaName;
                if (AreaName != areaName)
                {
                    AreaName = areaName;                     //When dealing with non standard routing in pages
                }
            }
            if (String.IsNullOrWhiteSpace(nodeName))
            {
                nodeName = urlInfo.NodeName;
                if (NodeName != nodeName)
                {
                    NodeName = nodeName;                     //When dealing with non standard routing in pages
                }
            }
            if (String.IsNullOrWhiteSpace(pageName))
            {
                pageName = urlInfo.PageName;
                if (PageName != pageName)
                {
                    PageName = pageName;                     //When dealing with non standard routing in pages
                }
            }
            if (recordId == null)
            {
                recordId = urlInfo.RecordId;
                if (RecordId != recordId)
                {
                    RecordId = recordId;                     //When dealing with non standard routing in pages
                }
            }
            if (relationId == null)
            {
                relationId = urlInfo.RelationId;
                if (RelationId != relationId)
                {
                    RelationId = relationId;                     //When dealing with non standard routing in pages
                }
            }
            if (parentRecordId == null)
            {
                parentRecordId = urlInfo.ParentRecordId;
                if (ParentRecordId != parentRecordId)
                {
                    ParentRecordId = parentRecordId;                     //When dealing with non standard routing in pages
                }
            }


            ErpRequestContext.SetCurrentApp(appName, areaName, nodeName);
            ErpRequestContext.SetCurrentPage(PageContext, pageName, appName, areaName, nodeName, recordId, relationId, parentRecordId);

            ErpRequestContext.RecordId       = recordId;
            ErpRequestContext.RelationId     = relationId;
            ErpRequestContext.ParentRecordId = parentRecordId;
            ErpRequestContext.PageContext    = PageContext;

            if (PageContext.HttpContext.Request.Query.ContainsKey("returnUrl"))
            {
                ReturnUrl = HttpUtility.UrlDecode(PageContext.HttpContext.Request.Query["returnUrl"].ToString());
            }
            ErpAppContext = ErpAppContext.Current;
            CurrentUrl    = PageUtils.GetCurrentUrl(PageContext.HttpContext);

            #region << Init Navigation >>
            //Application navigation
            if (ErpRequestContext.App != null)
            {
                var sitemap  = ErpRequestContext.App.Sitemap;
                var appPages = new PageService().GetAppControlledPages(ErpRequestContext.App.Id);
                //Calculate node Urls
                foreach (var area in sitemap.Areas)
                {
                    foreach (var currentNode in area.Nodes)
                    {
                        switch (currentNode.Type)
                        {
                        case SitemapNodeType.ApplicationPage:
                            var nodePages = appPages.FindAll(x => x.NodeId == currentNode.Id).ToList();
                            //Case 1: Node has attached pages
                            if (nodePages.Count > 0)
                            {
                                nodePages       = nodePages.OrderBy(x => x.Weight).ToList();
                                currentNode.Url = $"/{ErpRequestContext.App.Name}/{area.Name}/{currentNode.Name}/a/{nodePages[0].Name}";
                            }
                            else
                            {
                                var firstAppPage = appPages.FindAll(x => x.Type == PageType.Application).OrderBy(x => x.Weight).FirstOrDefault();
                                if (firstAppPage == null)
                                {
                                    currentNode.Url = $"/{ErpRequestContext.App.Name}/{area.Name}/{currentNode.Name}/a/";
                                }
                                else
                                {
                                    currentNode.Url = $"/{ErpRequestContext.App.Name}/{area.Name}/{currentNode.Name}/a/{firstAppPage.Name}";
                                }
                            }
                            break;

                        case SitemapNodeType.EntityList:
                            var firstListPage = appPages.FindAll(x => x.Type == PageType.RecordList && x.EntityId == currentNode.EntityId).OrderBy(x => x.Weight).FirstOrDefault();
                            if (firstListPage == null)
                            {
                                currentNode.Url = $"/{ErpRequestContext.App.Name}/{area.Name}/{currentNode.Name}/l/";
                            }
                            else
                            {
                                currentNode.Url = $"/{ErpRequestContext.App.Name}/{area.Name}/{currentNode.Name}/l/{firstListPage.Name}";
                            }
                            break;

                        case SitemapNodeType.Url:
                            //Do nothing
                            break;

                        default:
                            throw new Exception("Type not found");
                        }
                        continue;
                    }
                }
                //Convert to MenuItem
                foreach (var area in sitemap.Areas)
                {
                    if (area.Nodes.Count == 0)
                    {
                        continue;
                    }

                    var areaMenuItem = new MenuItem();
                    if (area.Nodes.Count > 1)
                    {
                        var areaLink = $"<a href=\"javascript: void(0)\" title=\"{area.Label}\" data-navclick-handler>";
                        areaLink    += $"<span class=\"menu-label\">{area.Label}</span>";
                        areaLink    += $"<span class=\"menu-nav-icon fa fa-angle-down nav-caret\"></span>";
                        areaLink    += $"</a>";
                        areaMenuItem = new MenuItem()
                        {
                            Content = areaLink
                        };

                        foreach (var node in area.Nodes)
                        {
                            var nodeLink = $"<a class=\"dropdown-item\" href=\"{node.Url}\" title=\"{node.Label}\"><span class=\"{node.IconClass} icon fa-fw\"></span> {node.Label}</a>";
                            areaMenuItem.Nodes.Add(new MenuItem()
                            {
                                Content = nodeLink
                            });
                        }
                    }
                    else if (area.Nodes.Count == 1)
                    {
                        var areaLink = $"<a href=\"{area.Nodes[0].Url}\" title=\"{area.Label}\">";
                        areaLink    += $"<span class=\"menu-label\">{area.Label}</span>";
                        areaLink    += $"</a>";
                        areaMenuItem = new MenuItem()
                        {
                            Content = areaLink
                        };
                    }

                    if (ErpRequestContext.SitemapArea == null && ErpRequestContext.Page != null && ErpRequestContext.Page.Type != PageType.Application)
                    {
                        return(new NotFoundResult());
                    }

                    if (ErpRequestContext.SitemapArea != null && area.Id == ErpRequestContext.SitemapArea.Id)
                    {
                        areaMenuItem.Class = "current";
                    }

                    //Process the an unusual case when the area has a node type URL which has a link to an app Page or a site page.
                    //Then there is no SitemapArea in the ErpRequest as the URL does not has the information about one but still it needs to be
                    //marked as current
                    if (ErpRequestContext.SitemapArea == null)
                    {
                        var urlNodes = area.Nodes.FindAll(x => x.Type == SitemapNodeType.Url);
                        var path     = HttpContext.Request.Path;
                        foreach (var urlNode in urlNodes)
                        {
                            if (path == urlNode.Url)
                            {
                                areaMenuItem.Class = "current";
                            }
                        }
                    }

                    ApplicationMenu.Add(areaMenuItem);
                }
            }

            //Site menu
            var pageSrv   = new PageService();
            var sitePages = pageSrv.GetSitePages();
            foreach (var sitePage in sitePages)
            {
                if (sitePage.Weight < 1000)
                {
                    SiteMenu.Add(new MenuItem()
                    {
                        Content = $"<a class=\"dropdown-item\" href=\"/s/{sitePage.Name}\">{sitePage.Label}</a>"
                    });
                }
            }


            #endregion


            DataModel = new PageDataModel(this);

            List <Guid> currentUserRoles = new List <Guid>();
            if (CurrentUser != null)
            {
                currentUserRoles.AddRange(CurrentUser.Roles.Select(x => x.Id));
            }

            if (ErpRequestContext.App != null)
            {
                if (ErpRequestContext.App.Access == null || ErpRequestContext.App.Access.Count == 0)
                {
                    new LocalRedirectResult("/error?401");
                }

                IEnumerable <Guid> rolesWithAccess = ErpRequestContext.App.Access.Intersect(currentUserRoles);
                if (!rolesWithAccess.Any())
                {
                    new LocalRedirectResult("/error?401");
                }
            }

            //Debug.WriteLine(">>>>>>>>>>>>>>>>>>>>>>>>>> Base page init: " + sw.ElapsedMilliseconds);
            return(null);
        }
Exemplo n.º 19
0
 public static void AttachContextMenu()
 {
     ApplicationMenu.Attach();
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="RibbonApplicationMenuBottomPaneSimpleButtonUIAdapter"/> class.
 /// </summary>
 /// <param name="workItem">The work item. Since Events are used this can
 /// be any work item including the root work item.</param>
 /// <param name="applicationMenu">The application menu.</param>
 public RibbonAppMenuBottomPaneSimpleButtonUIAdapter(WorkItem workItem,
                                                     ApplicationMenu applicationMenu)
     : this(workItem, applicationMenu, 26, 3)
 {
 }
Exemplo n.º 21
0
 private async void AuthenticationStateProviderOnAuthenticationStateChanged(Task <AuthenticationState> task)
 {
     Menu = await MenuManager.GetMainMenuAsync();
     await InvokeAsync(StateHasChanged);
 }
Exemplo n.º 22
0
 public void ShowApplicationMenu()
 {
     var myMenu = new ApplicationMenu();
 }
Exemplo n.º 23
0
 public static void DetachContextMenu()
 {
     ApplicationMenu.Detach();
 }
Exemplo n.º 24
0
 protected override async Task OnInitializedAsync()
 {
     Menu = await MenuManager.GetAsync(StandardMenus.Main);
 }
Exemplo n.º 25
0
 public void Initialize()
 {
     ApplicationMenu.Attach();
 }
Exemplo n.º 26
0
 public MenuConfigurationContext(ApplicationMenu menu, IServiceProvider serviceProvider)
 {
     Menu                 = menu;
     ServiceProvider      = serviceProvider;
     _lazyServiceProvider = ServiceProvider.GetRequiredService <IAbpLazyServiceProvider>();
 }
 /// <summary>
 /// Required method for Designer support - do not modify
 /// the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     this.components = new System.ComponentModel.Container();
     System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(CommonParentForm));
     this.rbnMain = new DevExpress.XtraBars.Ribbon.RibbonControl();
     this.appMenu = new DevExpress.XtraBars.Ribbon.ApplicationMenu(this.components);
     this.bbiSettings = new DevExpress.XtraBars.BarButtonItem();
     this.bbiExitUser = new DevExpress.XtraBars.BarButtonItem();
     this.siVersion = new DevExpress.XtraBars.BarStaticItem();
     this.alignButtonGroup = new DevExpress.XtraBars.BarButtonGroup();
     this.bbiAdd = new DevExpress.XtraBars.BarButtonItem();
     this.bbiRemove = new DevExpress.XtraBars.BarButtonItem();
     this.bbiRefresh = new DevExpress.XtraBars.BarButtonItem();
     this.bbiExel = new DevExpress.XtraBars.BarButtonItem();
     this.bbiAdmin = new DevExpress.XtraBars.BarButtonItem();
     this.bbiSave = new DevExpress.XtraBars.BarButtonItem();
     this.bbiRoleEdit = new DevExpress.XtraBars.BarButtonItem();
     this.brDockMenuItem = new DevExpress.XtraBars.BarDockingMenuItem();
     this.brEdItControlsStates = new DevExpress.XtraBars.BarEditItem();
     this.ripceControlsStates = new DevExpress.XtraEditors.Repository.RepositoryItemPopupContainerEdit();
     this.rpMain = new DevExpress.XtraBars.Ribbon.RibbonPage();
     this.rpgMain = new DevExpress.XtraBars.Ribbon.RibbonPageGroup();
     this.rpDictionaries = new DevExpress.XtraBars.Ribbon.RibbonPage();
     this.rpgCommonDictionaries = new DevExpress.XtraBars.Ribbon.RibbonPageGroup();
     this.rpReports = new DevExpress.XtraBars.Ribbon.RibbonPage();
     this.rpSettings = new DevExpress.XtraBars.Ribbon.RibbonPage();
     this.rpAdmin = new DevExpress.XtraBars.Ribbon.RibbonPage();
     this.rpgAdmin = new DevExpress.XtraBars.Ribbon.RibbonPageGroup();
     this.riceStates = new DevExpress.XtraEditors.Repository.RepositoryItemCheckEdit();
     this.rsbMain = new DevExpress.XtraBars.Ribbon.RibbonStatusBar();
     this.defaultLookAndFeel = new DevExpress.LookAndFeel.DefaultLookAndFeel(this.components);
     this.dxErrorProvider = new DevExpress.XtraEditors.DXErrorProvider.DXErrorProvider(this.components);
     this.documentMng = new DevExpress.XtraBars.Docking2010.DocumentManager(this.components);
     this.MDIViewNative = new DevExpress.XtraBars.Docking2010.Views.NativeMdi.NativeMdiView(this.components);
     this.MDIViewTabbed = new DevExpress.XtraBars.Docking2010.Views.Tabbed.TabbedView(this.components);
     this.bbiChangeUser = new DevExpress.XtraBars.BarButtonItem();
     ((System.ComponentModel.ISupportInitialize)(this.rbnMain)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.appMenu)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.ripceControlsStates)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.riceStates)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.dxErrorProvider)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.documentMng)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.MDIViewNative)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.MDIViewTabbed)).BeginInit();
     this.SuspendLayout();
     //
     // rbnMain
     //
     this.rbnMain.ApplicationButtonDropDownControl = this.appMenu;
     this.rbnMain.ApplicationButtonText = "Меню";
     this.rbnMain.AutoSizeItems = true;
     this.rbnMain.Categories.AddRange(new DevExpress.XtraBars.BarManagerCategory[] {
     new DevExpress.XtraBars.BarManagerCategory("Dictionaries", new System.Guid("bfb17616-73d9-42e6-8028-a10ce19e5160"))});
     this.rbnMain.ExpandCollapseItem.Id = 0;
     this.rbnMain.Items.AddRange(new DevExpress.XtraBars.BarItem[] {
     this.rbnMain.ExpandCollapseItem,
     this.siVersion,
     this.alignButtonGroup,
     this.bbiAdd,
     this.bbiRemove,
     this.bbiRefresh,
     this.bbiExel,
     this.bbiAdmin,
     this.bbiSave,
     this.bbiRoleEdit,
     this.brDockMenuItem,
     this.bbiSettings,
     this.brEdItControlsStates,
     this.bbiExitUser,
     this.bbiChangeUser});
     this.rbnMain.Location = new System.Drawing.Point(0, 0);
     this.rbnMain.MaxItemId = 162;
     this.rbnMain.Name = "rbnMain";
     this.rbnMain.Pages.AddRange(new DevExpress.XtraBars.Ribbon.RibbonPage[] {
     this.rpMain,
     this.rpDictionaries,
     this.rpReports,
     this.rpSettings,
     this.rpAdmin});
     this.rbnMain.RepositoryItems.AddRange(new DevExpress.XtraEditors.Repository.RepositoryItem[] {
     this.ripceControlsStates,
     this.riceStates});
     this.rbnMain.RibbonStyle = DevExpress.XtraBars.Ribbon.RibbonControlStyle.Office2013;
     this.rbnMain.ShowToolbarCustomizeItem = false;
     this.rbnMain.Size = new System.Drawing.Size(1210, 173);
     this.rbnMain.StatusBar = this.rsbMain;
     this.rbnMain.Toolbar.ItemLinks.Add(this.bbiAdd);
     this.rbnMain.Toolbar.ItemLinks.Add(this.bbiRemove);
     this.rbnMain.Toolbar.ItemLinks.Add(this.bbiRefresh);
     this.rbnMain.Toolbar.ItemLinks.Add(this.bbiSave);
     this.rbnMain.Toolbar.ItemLinks.Add(this.bbiExel);
     this.rbnMain.Toolbar.ItemLinks.Add(this.brDockMenuItem);
     this.rbnMain.Toolbar.ShowCustomizeItem = false;
     this.rbnMain.ToolbarLocation = DevExpress.XtraBars.Ribbon.RibbonQuickAccessToolbarLocation.Below;
     this.rbnMain.ShowCustomizationMenu += new DevExpress.XtraBars.Ribbon.RibbonCustomizationMenuEventHandler(this.RibbonShowCustomizationMenu);
     this.rbnMain.Merge += new DevExpress.XtraBars.Ribbon.RibbonMergeEventHandler(this.MainMerge);
     //
     // appMenu
     //
     this.appMenu.ItemLinks.Add(this.bbiSettings, true);
     this.appMenu.ItemLinks.Add(this.bbiChangeUser);
     this.appMenu.ItemLinks.Add(this.bbiExitUser);
     this.appMenu.Name = "appMenu";
     this.appMenu.Ribbon = this.rbnMain;
     //
     // bbiSettings
     //
     this.bbiSettings.Caption = "Настройки";
     this.bbiSettings.Description = "Настройки программы";
     this.bbiSettings.Hint = "Настройки программы";
     this.bbiSettings.Id = 76;
     this.bbiSettings.LargeGlyph = ((System.Drawing.Image)(resources.GetObject("bbiSettings.LargeGlyph")));
     this.bbiSettings.Name = "bbiSettings";
     //
     // bbiExitUser
     //
     this.bbiExitUser.Caption = "Выход";
     this.bbiExitUser.CategoryGuid = new System.Guid("6ffddb2b-9015-4d97-a4c1-91613e0ef537");
     this.bbiExitUser.Id = 160;
     this.bbiExitUser.LargeGlyph = ((System.Drawing.Image)(resources.GetObject("bbiExitUser.LargeGlyph")));
     this.bbiExitUser.Name = "bbiExitUser";
     //
     // siVersion
     //
     this.siVersion.Caption = "Версия:";
     this.siVersion.Id = 31;
     this.siVersion.Name = "siVersion";
     this.siVersion.TextAlignment = System.Drawing.StringAlignment.Near;
     //
     // alignButtonGroup
     //
     this.alignButtonGroup.Caption = "Align Commands";
     this.alignButtonGroup.Id = 52;
     this.alignButtonGroup.Name = "alignButtonGroup";
     //
     // bbiAdd
     //
     this.bbiAdd.Caption = "Добавить данные";
     this.bbiAdd.Glyph = ((System.Drawing.Image)(resources.GetObject("bbiAdd.Glyph")));
     this.bbiAdd.Hint = "Добавить новую запись в текущий элемент интерфейса";
     this.bbiAdd.Id = 62;
     this.bbiAdd.ItemShortcut = new DevExpress.XtraBars.BarShortcut((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.N));
     this.bbiAdd.Name = "bbiAdd";
     this.bbiAdd.ItemClick += new DevExpress.XtraBars.ItemClickEventHandler(this.AddItemClick);
     //
     // bbiRemove
     //
     this.bbiRemove.Caption = "Удалить данные";
     this.bbiRemove.Glyph = ((System.Drawing.Image)(resources.GetObject("bbiRemove.Glyph")));
     this.bbiRemove.Hint = "Удалить текущие данные";
     this.bbiRemove.Id = 63;
     this.bbiRemove.ItemShortcut = new DevExpress.XtraBars.BarShortcut((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Delete));
     this.bbiRemove.Name = "bbiRemove";
     this.bbiRemove.ItemClick += new DevExpress.XtraBars.ItemClickEventHandler(this.RemoveItemClick);
     //
     // bbiRefresh
     //
     this.bbiRefresh.Caption = "Обновить данные";
     this.bbiRefresh.Glyph = ((System.Drawing.Image)(resources.GetObject("bbiRefresh.Glyph")));
     this.bbiRefresh.Hint = "Обновить записи из базы данных";
     this.bbiRefresh.Id = 65;
     this.bbiRefresh.ItemShortcut = new DevExpress.XtraBars.BarShortcut(System.Windows.Forms.Keys.F5);
     this.bbiRefresh.Name = "bbiRefresh";
     this.bbiRefresh.ItemClick += new DevExpress.XtraBars.ItemClickEventHandler(this.RefreshItemClick);
     //
     // bbiExel
     //
     this.bbiExel.Caption = "Сохранить в Exel";
     this.bbiExel.Glyph = ((System.Drawing.Image)(resources.GetObject("bbiExel.Glyph")));
     this.bbiExel.Hint = "Сохранить данные в виде Excel";
     this.bbiExel.Id = 66;
     this.bbiExel.Name = "bbiExel";
     this.bbiExel.ItemClick += new DevExpress.XtraBars.ItemClickEventHandler(this.ExelItemClick);
     //
     // bbiAdmin
     //
     this.bbiAdmin.Caption = "Настройка интерфейсов";
     this.bbiAdmin.Glyph = ((System.Drawing.Image)(resources.GetObject("bbiAdmin.Glyph")));
     this.bbiAdmin.Hint = "Администрирование внешнего вида форм";
     this.bbiAdmin.Id = 69;
     this.bbiAdmin.LargeGlyph = ((System.Drawing.Image)(resources.GetObject("bbiAdmin.LargeGlyph")));
     this.bbiAdmin.Name = "bbiAdmin";
     this.bbiAdmin.ItemClick += new DevExpress.XtraBars.ItemClickEventHandler(this.AdminItemClick);
     //
     // bbiSave
     //
     this.bbiSave.Caption = "Сохранить в базу";
     this.bbiSave.Glyph = ((System.Drawing.Image)(resources.GetObject("bbiSave.Glyph")));
     this.bbiSave.Hint = "Сохранить изменения текущего элемента на сервер";
     this.bbiSave.Id = 70;
     this.bbiSave.ItemShortcut = new DevExpress.XtraBars.BarShortcut((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.S));
     this.bbiSave.Name = "bbiSave";
     this.bbiSave.ItemClick += new DevExpress.XtraBars.ItemClickEventHandler(this.CommitItemClick);
     //
     // bbiRoleEdit
     //
     this.bbiRoleEdit.Caption = "Настройка ролей и сотрудников";
     this.bbiRoleEdit.Glyph = ((System.Drawing.Image)(resources.GetObject("bbiRoleEdit.Glyph")));
     this.bbiRoleEdit.Id = 71;
     this.bbiRoleEdit.LargeGlyph = ((System.Drawing.Image)(resources.GetObject("bbiRoleEdit.LargeGlyph")));
     this.bbiRoleEdit.Name = "bbiRoleEdit";
     this.bbiRoleEdit.ItemClick += new DevExpress.XtraBars.ItemClickEventHandler(this.RoleEditItemClick);
     //
     // brDockMenuItem
     //
     this.brDockMenuItem.Caption = "Расположение форм";
     this.brDockMenuItem.Glyph = ((System.Drawing.Image)(resources.GetObject("brDockMenuItem.Glyph")));
     this.brDockMenuItem.Hint = "Настройка расположения форм";
     this.brDockMenuItem.Id = 78;
     this.brDockMenuItem.Name = "brDockMenuItem";
     //
     // brEdItControlsStates
     //
     this.brEdItControlsStates.Edit = this.ripceControlsStates;
     this.brEdItControlsStates.Id = 89;
     this.brEdItControlsStates.Name = "brEdItControlsStates";
     //
     // ripceControlsStates
     //
     this.ripceControlsStates.AutoHeight = false;
     this.ripceControlsStates.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
     new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)});
     this.ripceControlsStates.Name = "ripceControlsStates";
     //
     // rpMain
     //
     this.rpMain.Groups.AddRange(new DevExpress.XtraBars.Ribbon.RibbonPageGroup[] {
     this.rpgMain});
     this.rpMain.Name = "rpMain";
     this.rpMain.Text = "Главная";
     //
     // rpgMain
     //
     this.rpgMain.Name = "rpgMain";
     this.rpgMain.Text = "Главное";
     //
     // rpDictionaries
     //
     this.rpDictionaries.Groups.AddRange(new DevExpress.XtraBars.Ribbon.RibbonPageGroup[] {
     this.rpgCommonDictionaries});
     this.rpDictionaries.Name = "rpDictionaries";
     this.rpDictionaries.Text = "Справочники";
     //
     // rpgCommonDictionaries
     //
     this.rpgCommonDictionaries.Name = "rpgCommonDictionaries";
     this.rpgCommonDictionaries.Text = "Общие";
     //
     // rpReports
     //
     this.rpReports.Name = "rpReports";
     this.rpReports.Text = "Отчёты";
     //
     // rpSettings
     //
     this.rpSettings.Name = "rpSettings";
     this.rpSettings.Text = "Настройки системы";
     //
     // rpAdmin
     //
     this.rpAdmin.Groups.AddRange(new DevExpress.XtraBars.Ribbon.RibbonPageGroup[] {
     this.rpgAdmin});
     this.rpAdmin.Name = "rpAdmin";
     this.rpAdmin.Text = "Администрирование";
     this.rpAdmin.Visible = false;
     //
     // rpgAdmin
     //
     this.rpgAdmin.ItemLinks.Add(this.bbiAdmin);
     this.rpgAdmin.ItemLinks.Add(this.bbiRoleEdit);
     this.rpgAdmin.Name = "rpgAdmin";
     this.rpgAdmin.Text = "Администратор";
     //
     // riceStates
     //
     this.riceStates.Name = "riceStates";
     this.riceStates.NullStyle = DevExpress.XtraEditors.Controls.StyleIndeterminate.Unchecked;
     //
     // rsbMain
     //
     this.rsbMain.ItemLinks.Add(this.siVersion);
     this.rsbMain.Location = new System.Drawing.Point(0, 669);
     this.rsbMain.Name = "rsbMain";
     this.rsbMain.Ribbon = this.rbnMain;
     this.rsbMain.Size = new System.Drawing.Size(1210, 31);
     //
     // dxErrorProvider
     //
     this.dxErrorProvider.ContainerControl = this;
     //
     // documentMng
     //
     this.documentMng.MdiParent = this;
     this.documentMng.MenuManager = this.rbnMain;
     this.documentMng.ShowThumbnailsInTaskBar = DevExpress.Utils.DefaultBoolean.False;
     this.documentMng.View = this.MDIViewNative;
     this.documentMng.ViewCollection.AddRange(new DevExpress.XtraBars.Docking2010.Views.BaseView[] {
     this.MDIViewNative,
     this.MDIViewTabbed});
     //
     // bbiChangeUser
     //
     this.bbiChangeUser.Caption = "Сменить пользователя";
     this.bbiChangeUser.Id = 161;
     this.bbiChangeUser.LargeGlyph = ((System.Drawing.Image)(resources.GetObject("bbiChangeUser.LargeGlyph")));
     this.bbiChangeUser.Name = "bbiChangeUser";
     //
     // CommonParentForm
     //
     this.AllowFormGlass = DevExpress.Utils.DefaultBoolean.False;
     this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
     this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
     this.ClientSize = new System.Drawing.Size(1210, 700);
     this.Controls.Add(this.rsbMain);
     this.Controls.Add(this.rbnMain);
     this.IsMdiContainer = true;
     this.Name = "CommonParentForm";
     this.Ribbon = this.rbnMain;
     this.StatusBar = this.rsbMain;
     this.WindowState = System.Windows.Forms.FormWindowState.Maximized;
     this.Activated += new System.EventHandler(this.CommonParentFormActivated);
     this.Load += new System.EventHandler(this.CommonParentFormLoad);
     this.Shown += new System.EventHandler(this.CommonParentFormShown);
     ((System.ComponentModel.ISupportInitialize)(this.rbnMain)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.appMenu)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.ripceControlsStates)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.riceStates)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.dxErrorProvider)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.documentMng)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.MDIViewNative)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.MDIViewTabbed)).EndInit();
     this.ResumeLayout(false);
     this.PerformLayout();
 }
Exemplo n.º 28
0
 protected override async Task OnInitializedAsync()
 {
     Menu = await MenuManager.GetMainMenuAsync();
 }
Exemplo n.º 29
0
    protected override async Task OnInitializedAsync()
    {
        Menu = await MenuManager.GetMainMenuAsync();

        AuthenticationStateProvider.AuthenticationStateChanged += AuthenticationStateProviderOnAuthenticationStateChanged;
    }
Exemplo n.º 30
0
        protected override async Task OnInitializedAsync()
        {
            Menu = await MenuManager.GetAsync(StandardMenus.User);

            Navigation.LocationChanged += OnLocationChanged;
        }
Exemplo n.º 31
0
        void SetMenuItemActivateCssClass(string pageUrl, ApplicationMenuItem menuItem = null, ApplicationMenu parentMenu = null)
        {
            ApplicationMenuItemList withItems = menuItem?.Items ?? parentMenu?.Items;

            withItems.ForEach(m =>
            {
                if (m.Url != null && pageUrl == $"{m.Url}/index".ToUpper())
                {
                    m.CssClass = "active";
                    // 存在父级
                    if (menuItem != null)
                    {
                        menuItem.CssClass = "active menu-open";
                    }
                }
                SetMenuItemActivateCssClass(pageUrl, m, parentMenu);
            });
        }