示例#1
0
        private void RefreshProgressBar()
        {
            var remainingSeconds = AutorefreshProgressBar.Maximum - (DateTime.Now - _lastRefresh).TotalSeconds;

            if (remainingSeconds < 0)
            {
                if (AutoRefreshEnabled)
                {
                    RefreshTimerTickHandler(this, EventArgs.Empty);
                }

                remainingSeconds = 0;
            }
            else
            {
                AdjustProgressBarRefreshInterval(remainingSeconds);
            }

            AutorefreshProgressBar.Value = remainingSeconds;
            if (remainingSeconds > 10)
            {
                remainingSeconds = Math.Round(remainingSeconds);
            }

            AutorefreshProgressBar.ToolTip = remainingSeconds == 0
                                ? "refreshing... "
                                : $"last refresh: {CellValueConverter.FormatDateTime(_lastRefresh)}; remaining: {TimeSpan.FromSeconds(remainingSeconds).ToPrettyString()}";
        }
示例#2
0
        private void SearchTextChangedHandler(object sender, TextChangedEventArgs args)
        {
            var searchedWords = TextSearchHelper.GetSearchedWords(SearchPhraseTextBox.Text);

            _collectionView.Filter = searchedWords.Length == 0
                                ? (Predicate <object>)null
                                : e =>
            {
                var entry        = (StatementExecutionHistoryEntry)e;
                var textToSearch = $"{entry.StatementText.ToUpperInvariant()} {CellValueConverter.FormatDateTime(entry.ExecutedAt).ToUpperInvariant()} {entry.Tags?.ToUpperInvariant()}";
                return(searchedWords.All(textToSearch.Contains));
            };

            ListHistoryEntries.UpdateLayout();

            HighlightText(searchedWords);
        }
示例#3
0
 public override object Convert(object value, Type targetType, object parameter, CultureInfo culture)
 {
     return(value == null || (DateTime)value == DateTime.MinValue ? _valueNotAvailablePlaceholder : CellValueConverter.FormatDateTime((DateTime)value));
 }