void FindPrev() { if (MatchSpots.Count == 0) { return; } if (CurrentSpot == 0) { CurrentSpot = MatchSpots.Count - 1; } else { CurrentSpot--; } if (IsInBinaryMode) { MainRichText.Select(MatchSpots[CurrentSpot], Keyword.Length); MainRichText.ScrollToCaret(); } else { MainText.Select(MatchSpots[CurrentSpot], Keyword.Length); MainText.ScrollToCaret(); } }
void find() { reset_values(); keyword = searchbox.Text; if (keyword.Length == 0) { return; } bool loop = true; int start_index = 0; while (loop) { loop = false; int match_spot = MainText.Text.IndexOf(keyword, start_index, StringComparison.CurrentCultureIgnoreCase); if (match_spot >= 0) { match_spots.Add(match_spot); if ((match_spot + keyword.Length) < MainText.Text.Length) { start_index = match_spot + 1; loop = true; } } } matches.Text = match_spots.Count.ToString(); if (match_spots.Count > 0) { MainText.Select(match_spots[0], keyword.Length); MainText.ScrollToCaret(); } }
void Find() { ResetValues(); Keyword = SearchBox.Text; if (IsInBinaryMode) { TextToSearch = MainRichText.Text; } else { TextToSearch = MainText.Text; } if (Keyword.Length == 0) { return; } bool loop = true; int StartIndex = 0; while (loop) { loop = false; int match_spot = TextToSearch.IndexOf(Keyword, StartIndex, ComparisonType); if (match_spot >= 0) { MatchSpots.Add(match_spot); if ((match_spot + Keyword.Length) < TextToSearch.Length) { StartIndex = match_spot + 1; loop = true; } } } MatchCountLabel.Text = MatchSpots.Count.ToString(); if (MatchSpots.Count > 0) { if (IsInBinaryMode) { MainRichText.Select(MatchSpots[0], Keyword.Length); MainRichText.ScrollToCaret(); } else { MainText.Select(MatchSpots[0], Keyword.Length); MainText.ScrollToCaret(); } } }
void find_prev() { if (match_spots.Count == 0) { return; } if (current_spot == 0) { current_spot = match_spots.Count - 1; } else { current_spot--; } MainText.Select(match_spots[current_spot], keyword.Length); MainText.ScrollToCaret(); }
void find_next() { if (match_spots.Count == 0) { return; } if (current_spot == (match_spots.Count - 1)) { current_spot = 0; } else { current_spot++; } MainText.Select(match_spots[current_spot], keyword.Length); MainText.ScrollToCaret(); }
public MainWindowViewModel() { MainText.AddTo(Disposable); LowerText = MainText .Select(x => ConvertLower(x)) .ToReadOnlyReactivePropertySlim() .AddTo(Disposable); TextCount = MainText .Select(s => s.Length) .ToReadOnlyReactivePropertySlim() .AddTo(Disposable); Now = Observable.Interval(TimeSpan.FromSeconds(1)) .Select(_ => DateTime.Now) .ToReadOnlyReactivePropertySlim(DateTime.Now) .AddTo(Disposable); }