Skip to content

Commit fa409a8

Browse files
author
Snorri Gislason
committed
Load resource stream outside of delegate
1 parent a592169 commit fa409a8

File tree

1 file changed

+13
-10
lines changed

1 file changed

+13
-10
lines changed

ILSpy/TextView/DecompilerTextView.cs

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1447,17 +1447,20 @@ public static void RegisterHighlighting(
14471447

14481448
if (resourceStream != null)
14491449
{
1450+
IHighlightingDefinition highlightingDefinition;
1451+
1452+
using (resourceStream)
1453+
using (XmlTextReader reader = new XmlTextReader(resourceStream))
1454+
{
1455+
highlightingDefinition = HighlightingLoader.Load(reader, manager);
1456+
}
1457+
14501458
manager.RegisterHighlighting(
1451-
name, extensions,
1452-
delegate {
1453-
using (resourceStream)
1454-
using (XmlTextReader reader = new XmlTextReader(resourceStream))
1455-
{
1456-
var highlightingDefinition = HighlightingLoader.Load(reader, manager);
1457-
ThemeManager.Current.ApplyHighlightingColors(highlightingDefinition);
1458-
return highlightingDefinition;
1459-
}
1460-
});
1459+
name, extensions,
1460+
delegate {
1461+
ThemeManager.Current.ApplyHighlightingColors(highlightingDefinition);
1462+
return highlightingDefinition;
1463+
});
14611464
}
14621465
}
14631466
}

0 commit comments

Comments
 (0)