Esempio n. 1
0
        internal static List <SearchColumn> Enumerate(SearchContext context, IEnumerable <SearchItem> items)
        {
            var columns = new List <SearchColumn>(ItemSelectors.Enumerate(items));

            var providerTypes = new HashSet <string>(context.providers.Select(p => p.type));

            foreach (var s in SelectorManager.selectors)
            {
                if (!s.printable)
                {
                    continue;
                }

                if (!string.IsNullOrEmpty(s.provider) && !providerTypes.Contains(s.provider))
                {
                    continue;
                }

                columns.Add(new SearchColumn($"Selectors/{s.label}", s.label));
            }

            foreach (var p in context.providers)
            {
                if (p.fetchColumns == null)
                {
                    continue;
                }

                columns.AddRange(p.fetchColumns(context, items.Take(50)));
            }

            return(columns);
        }
Esempio n. 2
0
 internal static SearchTable CreateDefault(IEnumerable <SearchItem> items = null)
 {
     return(new SearchTable("Default", ItemSelectors.Enumerate(items)
                            .Select(c => { c.options |= SearchColumnFlags.Volatile; return c; })));
 }