public QuickLinkExplore(ExploreOptions options)
        {
            Options = options;
            Label   = QueryUtils.GetNiceName(Options.QueryName);
            //Icon = Navigator.Manager.GetFindIcon(Options.QueryName, false);
            IsVisible = Finder.IsFindable(Options.QueryName);

            if (ShowResultCount && IsVisible)
            {
                EvaluateFunValues();

                DynamicQueryServer.QueryCountBatch(new QueryCountOptions(Options.QueryName)
                {
                    FilterOptions = options.FilterOptions,
                }, count =>
                {
                    Label = "{0} ({1})".FormatWith(Label, count);
                }, () => { });
            }
        }
Exemple #2
0
        public void Search()
        {
            if (IsSearching)
            {
                searchQueued = true;
                return;
            }

            FormattedText = (TextWaiting ?? QueryUtils.GetNiceName(QueryName) + "...");
            tb.FontWeight = FontWeights.Regular;

            var options = new QueryCountOptions
            {
                QueryName     = QueryName,
                FilterOptions = FilterOptions.ToList()
            };

            DynamicQueryServer.QueryCountBatch(options, count =>
            {
                ItemsCount = count;
                if (ItemsCount == 0)
                {
                    FormattedText = (TextZeroItems ?? SearchMessage.ThereIsNo0.NiceToString()).FormatWith(QueryUtils.GetNiceName(QueryName));
                    tb.FontWeight = FontWeights.Regular;
                }
                else
                {
                    FormattedText = (Text ?? (QueryUtils.GetNiceName(QueryName) + ": {0}")).FormatWith(ItemsCount);
                    tb.FontWeight = FontWeights.Bold;
                }

                if (searchQueued)
                {
                    searchQueued = false;
                    Search();
                }
            },
                                               () => { });
        }