Browse Source

Merge pull request #3389 from snorrk/master

Load resource stream outside of delegate
pull/3391/head
Siegfried Pammer 3 months ago committed by GitHub
parent
commit
7d715a4ac3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 23
      ILSpy/TextView/DecompilerTextView.cs

23
ILSpy/TextView/DecompilerTextView.cs

@ -1447,17 +1447,20 @@ namespace ICSharpCode.ILSpy.TextView @@ -1447,17 +1447,20 @@ namespace ICSharpCode.ILSpy.TextView
if (resourceStream != null)
{
IHighlightingDefinition highlightingDefinition;
using (resourceStream)
using (XmlTextReader reader = new XmlTextReader(resourceStream))
{
highlightingDefinition = HighlightingLoader.Load(reader, manager);
}
manager.RegisterHighlighting(
name, extensions,
delegate {
using (resourceStream)
using (XmlTextReader reader = new XmlTextReader(resourceStream))
{
var highlightingDefinition = HighlightingLoader.Load(reader, manager);
ThemeManager.Current.ApplyHighlightingColors(highlightingDefinition);
return highlightingDefinition;
}
});
name, extensions,
delegate {
ThemeManager.Current.ApplyHighlightingColors(highlightingDefinition);
return highlightingDefinition;
});
}
}
}

Loading…
Cancel
Save