Ejemplo n.º 1
0
 public static IEnumerable <SearchColumn> Enumerate(IEnumerable <SearchItem> items)
 {
     return(PropertySelectors.Enumerate(items).Concat(new[]
     {
         new SearchColumn("GameObject/Enabled", "enabled", "GameObject/Enabled", options: SearchColumnFlags.TextAlignmentCenter)
     }));
 }
Ejemplo n.º 2
0
        private IEnumerable <SearchProposition> FetchPropositions(SearchContext context, SearchPropositionOptions options)
        {
            var category = options.HasAny(SearchPropositionFlags.QueryBuilder) ? "Expressions" : null;

            foreach (var e in EvaluatorManager.evaluators)
            {
                var help = e.description ?? "Expression evaluator";
                yield return(new SearchProposition(category: category, $"{e.name}{{}}", $"{e.name.ToLowerInvariant()}{{\t}}", help, 1));
            }

            if (options.tokens.Length > 0 && options.tokens[0].Length > 0)
            {
                var token = options.tokens[0][0];
                if (token == '#')
                {
                    foreach (var c in PropertySelectors.Enumerate(context.searchView.results.Take(10)))
                    {
                        yield return(new SearchProposition(category: category, label: $"{token}{c.content.text ?? c.path}", $"{c.selector}\t", $"Property ({c.selector})"));
                    }
                }

                if (token == '@')
                {
                    foreach (var s in SelectorManager.selectors.Where(s => s.printable))
                    {
                        yield return(new SearchProposition(category: category, label: $"{token}{s.label}", help: s.description ?? "Selector", replacement: $"@{s.label}\t"));
                    }
                }
            }
        }
Ejemplo n.º 3
0
 public static IEnumerable <SearchColumn> Enumerate(IEnumerable <SearchItem> items)
 {
     #if USE_SEARCH_MODULE
     return(PropertySelectors.Enumerate(FilterItems(items, 5))
            .Concat(MaterialSelectors.Enumerate(FilterItems(items, 20))));
     #else
     return(PropertySelectors.Enumerate(FilterItems(items, 5)));
     #endif
 }
Ejemplo n.º 4
0
 public static IEnumerable <SearchColumn> Enumerate(IEnumerable <SearchItem> items)
 {
     return(PropertySelectors.Enumerate(FilterItems(items, 5))
            .Concat(MaterialSelectors.Enumerate(FilterItems(items, 20))));
 }