示例#1
0
        private void BuildMenus()
        {
            ActionCollection allItems = (this.DataSource as ActionCollection);

            if (allItems == null)
            {
                if ((this.ParentAction == null) || (this.ParentAction.ActionType != ActionType.Page))
                {
                    return;
                }

                allItems = m_ParentAction.GetAvailableChildActions(m_ActionIdList, m_IsFrameworkAdmin, m_IsAuthenticated);

                bool flag = false;
                if (MasterPage != null)
                {
                    flag = (MasterPage.IsHomepage && ((!MasterPage.VisibleMainMenu) || allItems.Count == 0));
                }

                if (flag || (this.VisibleSiblingItems.HasValue && this.VisibleSiblingItems.Value))
                {
                    ActionCollection siblingActions = new ActionCollection();
                    foreach (Micajah.Common.Bll.Action item in ActionProvider.PagesAndControls.GetAvailableSiblingActions(m_ParentAction))
                    {
                        if (ActionProvider.ShowAction(item, m_ActionIdList, m_IsFrameworkAdmin, m_IsAuthenticated))
                        {
                            siblingActions.Add(item);
                        }
                    }
                    allItems.AddRange(siblingActions);
                }
            }

            if (allItems != null)
            {
                foreach (Micajah.Common.Bll.Action item in allItems)
                {
                    if (item.ShowInDetailMenu)
                    {
                        m_PrimaryMenuItems.Add(item);
                    }
                    else
                    {
                        m_OtherMenuItems.Add(item);
                    }
                }
            }
        }
示例#2
0
 /// <summary>
 /// Load a group of actions for the provided module action list
 /// </summary>
 /// <param name="actionGroup">The name of the group of actions in the xml file</param>
 /// <param name="actionName">The name of the actions to load (trigger)</param>
 /// <param name="doc">The xml document from which the actions will be loaded</param>
 /// <param name="ac">The action list to load the actions within</param>
 /// <param name="log">The log writer</param>
 private static void LoadModuleActions(string actionGroup, string actionName, XmlDocument doc, ActionCollection ac, ILogWriter log)
 {
     if (doc.GetElementsByTagName(actionGroup).Count > 0)
         ac.AddRange(XtractActionList(doc.GetElementsByTagName(actionGroup)[0].ChildNodes));
     if (ac.Count > 0)
         log.WriteLine(2, "\t" + ac.Count.ToString() + " " + actionName + " actions added");
 }