Exemple #1
0
        public static List <IMenuItem> GetContextualItemListForLites(SelectedItemsMenuContext ctx)
        {
            List <IMenuItem> items = new List <IMenuItem>();

            if (!ctx.Lites.IsNullOrEmpty())
            {
                if (GetContextualItemsForLites != null)
                {
                    foreach (var block in GetContextualItemsForLites.GetInvocationListTyped().Select(d => d(ctx)).NotNull().OrderBy(a => a.Order))
                    {
                        if (items.Any() && block.Items.NotNull().Any())
                        {
                            items.Add(new MenuItemSeparator());
                        }

                        if (block.Header.HasText())
                        {
                            items.Add(new MenuItemHeader(block.Header));
                        }

                        items.AddRange(block.Items.NotNull());
                    }
                }
            }
            return(items);
        }
Exemple #2
0
        public static List<IMenuItem> GetContextualItemListForLites(SelectedItemsMenuContext ctx)
        {
            List<IMenuItem> items = new List<IMenuItem>();
            if (!ctx.Lites.IsNullOrEmpty())
            {
                if (GetContextualItemsForLites != null)
                {
                    foreach (var block in GetContextualItemsForLites.GetInvocationListTyped().Select(d=>d(ctx)).NotNull().OrderBy(a=>a.Order))
                    {
                        if (items.Any() && block.Items.NotNull().Any())
                            items.Add(new MenuItemSeparator());

                        if (block.Header.HasText())
                            items.Add(new MenuItemHeader(block.Header));

                        items.AddRange(block.Items.NotNull());
                    }
                }
            }
            return items;
        }
Exemple #3
0
        public static List<IMenuItem> GetContextualItemListForLites(SelectedItemsMenuContext ctx)
        {
            List<IMenuItem> items = new List<IMenuItem>();
            if (!ctx.Lites.IsNullOrEmpty())
            {
                if (GetContextualItemsForLites != null)
                {
                    foreach (Func<SelectedItemsMenuContext, List<IMenuItem>> d in GetContextualItemsForLites.GetInvocationList())
                    {
                        var newItems = d(ctx);

                        if (newItems != null)
                        {
                            if (items.Any() && newItems.NotNull().Any())
                                items.Add(new MenuItemSeparator());

                            items.AddRange(newItems.NotNull());
                        }
                    }
                }
            }
            return items;
        }
        internal static MenuItemBlock ContextualItemsHelper_GetContextualItemsForLite(SelectedItemsMenuContext ctx)
        {
            if (ctx.Lites.IsNullOrEmpty() || ctx.Lites.Count > 1)
            {
                return(null);
            }

            List <QuickLink> quickLinks = LinksClient.GetForEntity(ctx.Lites[0], null, ctx.Prefix, ctx.QueryName, ctx.Url);

            if (quickLinks.IsNullOrEmpty())
            {
                return(null);
            }

            return(new MenuItemBlock {
                Header = QuickLinkMessage.Quicklinks.NiceToString(), Items = quickLinks
            });
        }