Browse Source

do not load images on a background thread

pull/37/head
Siegfried Pammer 15 years ago
parent
commit
bba65cf3ae
  1. 32
      ILSpy/TreeNodes/ResourceEntryNode.cs

32
ILSpy/TreeNodes/ResourceEntryNode.cs

@ -45,21 +45,23 @@ namespace ICSharpCode.ILSpy.TreeNodes
AvalonEditTextOutput output = new AvalonEditTextOutput(); AvalonEditTextOutput output = new AvalonEditTextOutput();
IHighlightingDefinition highlighting = null; IHighlightingDefinition highlighting = null;
textView.RunWithCancellation( if (LoadImage(output)) {
token => Task.Factory.StartNew( textView.Show(output, highlighting);
() => { } else {
try { textView.RunWithCancellation(
if (LoadImage(output)) token => Task.Factory.StartNew(
highlighting = null; () => {
else if (LoadBaml(output)) try {
highlighting = HighlightingManager.Instance.GetDefinitionByExtension(".xml"); if (LoadBaml(output))
} catch (Exception ex) { highlighting = HighlightingManager.Instance.GetDefinitionByExtension(".xml");
output.Write(ex.ToString()); } catch (Exception ex) {
} output.Write(ex.ToString());
return output; }
}), return output;
t => textView.Show(t.Result, highlighting) }),
); t => textView.Show(t.Result, highlighting)
);
}
return true; return true;
} }

Loading…
Cancel
Save