diff --git a/RobloxFileFormat.dll b/RobloxFileFormat.dll index c7cc833..a9c5011 100644 Binary files a/RobloxFileFormat.dll and b/RobloxFileFormat.dll differ diff --git a/XmlFormat/XmlPropertyTokens.cs b/XmlFormat/XmlPropertyTokens.cs index d15d4e3..03caf9a 100644 --- a/XmlFormat/XmlPropertyTokens.cs +++ b/XmlFormat/XmlPropertyTokens.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.Reflection; using System.ComponentModel; using System.Linq; using System.Xml; @@ -14,13 +15,16 @@ namespace RobloxFiles.XmlFormat { // Initialize the PropertyToken handler singletons. Type IXmlPropertyToken = typeof(IXmlPropertyToken); + var assembly = Assembly.GetExecutingAssembly(); - var handlerTypes = AppDomain.CurrentDomain.GetAssemblies() - .SelectMany(assembly => assembly.GetTypes()) - .Where(type => type != IXmlPropertyToken) - .Where(type => IXmlPropertyToken.IsAssignableFrom(type)); + var handlerTypes = assembly.GetTypes() + .Where(type => IXmlPropertyToken.IsAssignableFrom(type)) + .Where(type => type != IXmlPropertyToken); + + var propTokens = handlerTypes + .Select(handlerType => Activator.CreateInstance(handlerType)) + .Cast(); - var propTokens = handlerTypes.Select(handlerType => Activator.CreateInstance(handlerType) as IXmlPropertyToken); var tokenHandlers = new Dictionary(); foreach (IXmlPropertyToken propToken in propTokens)