mirror of
https://github.com/icsharpcode/ILSpy.git
synced 2026-10-12 02:15:58 +00:00
Load resource stream outside of delegate
This commit is contained in:
@@ -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;
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user