Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
wobba committed Mar 5, 2020
1 parent 5b7d403 commit 9975168
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1838,14 +1838,8 @@ private string CustomizeTitle(string userFormat, ResultItem resultItem, int coun
foreach (KeyValuePair<string, string> item in resultItem)
{
var oldValue = "{" + $"{item.Key}" + "}";
var newValue = "";
if (resultItem.ContainsKey(item.Key))
{
newValue = resultItem[item.Key] + "";
}

customizedTitle = customizedTitle.Replace(oldValue, newValue);

var newValue = resultItem[item.Key] + "";
customizedTitle = Regex.Replace(customizedTitle, oldValue, newValue, RegexOptions.IgnoreCase);
}

customizedTitle = customizedTitle.Replace("{counter}", $"{counter}");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,14 @@ public SearchPresentationSettings()

private void OnLoaded(object sender, RoutedEventArgs e)
{
if (_mainWindow.SearchPresentationSettings == null) _mainWindow.SearchPresentationSettings = new Model.SearchResultPresentationSettings();
TitleFormatTextBox.Text = _mainWindow.SearchPresentationSettings.PrimaryResultsTitleFormat;
}

private void Ok_OnClick(object sender, RoutedEventArgs e)
{
_mainWindow.SearchPresentationSettings.PrimaryResultsTitleFormat = TitleFormatTextBox.Text;

Close();
}

Expand Down

0 comments on commit 9975168

Please sign in to comment.