
Hey guys, had a question...
Looking through the documentation the current search feature uses a non-async method call, which ends up running on the UI thread:
StatusBarError(StatusBarChangeType.Informational, "Searching...", true);
EditorSearchOptions eso = new EditorSearchOptions();
eso.FindText = tb.Text;
eso.PatternProvider = SearchPatternProviders.Normal;
var find = lastEditor.ActiveView.Searcher.FindNext(eso);
if (find.Results.Count < 1)
{
StatusBarError(StatusBarChangeType.Error, string.Format("Text '{0}' not found", tb.Text), false);
}
else
{
StatusBarError(StatusBarChangeType.Reset, "", false);
}
I have a function that changes the status bar for informational purposes, as you can see above, but when the UI thread locks, the UI won't update, and so "Searching..." is never displayed to the user. Now, I'd be okay with the Editor switching to IsEnabled = false, or something, while searching, but is there a way to at least have this operation happen asynchronously, so the application doesn't appear frozen to the user, and other things can display? The project I'm working on has me often searching through 5-15 MB XML documents, sometimes larger, so this would be pretty useful. Other than that, the XML documents load and highlight immediately, and so far the control's been great to work with.
Thanks again for your time-