in src/StructuredLogViewer.Avalonia/Controls/BuildControl.xaml.cs [293:376]
private void UpdateWatermark()
{
string watermarkText1 = @"Type in the search box to search. Press Ctrl+F to focus the search box. Results (up to 1000) will display here.
Search for multiple words separated by space (space means AND). Enclose multiple words in double-quotes """" to search for the exact phrase. Enclose a single word in quotes to search for exact match (turns off substring search).
Use syntax like '$property Prop' to narrow results down by item kind. Supported kinds: ";
string watermarkText2 = @"Use the under(FILTER) clause to filter results to only the nodes where any of the parent nodes in the parent chain matches the FILTER. Examples:
• $task csc under($project Core)
• Copying file under(Parent)
Examples:
";
//Inline MakeLink(string query, string before = " \u2022 ", string after = "\r\n")
//{
// var hyperlink = new Hyperlink(new Run(query));
// hyperlink.Click += (s, e) => searchLogControl.SearchText = query;
// var span = new System.Windows.Documents.Span();
// if (before != null)
// {
// span.Inlines.Add(new Run(before));
// }
// span.Inlines.Add(hyperlink);
// if (after != null)
// {
// if (after == "\r\n")
// {
// span.Inlines.Add(new LineBreak());
// }
// else
// {
// span.Inlines.Add(new Run(after));
// }
// }
// return span;
//}
var text = watermarkText1;
text += watermarkText1;
bool isFirst = true;
foreach (var nodeKind in nodeKinds)
{
if (!isFirst)
{
text += ", ";
}
isFirst = false;
//text += (MakeLink(nodeKind, before: null, after: null));
text += nodeKind;
}
text += Environment.NewLine + Environment.NewLine;
text += watermarkText2;
foreach (var example in searchExamples)
{
//text += (MakeLink(example));
text += " \u2022 " + example + Environment.NewLine;
}
var recentSearches = SettingsService.GetRecentSearchStrings();
if (recentSearches.Any())
{
text += @"
Recent:
";
foreach (var recentSearch in recentSearches.Where(s => !searchExamples.Contains(s) && !nodeKinds.Contains(s)))
{
//text += MakeLink(recentSearch));
text += " \u2022 " + recentSearch + Environment.NewLine;
}
}
searchLogControl.WatermarkContent = new TextBlock { Text = text };
}