简体   繁体   中英

How to backport .NET 4's XmlConvert.IsWhitespaceChar to .NET 3.5?

I need to backport some code that uses this method to .NET 3.5, and from Reflector I can't seem to discern what would be the correct way to provide my own C# implementation for it.

Any help?

That method uses an embedded resource named XmlCharType.bin, you can see it with Reflector. It is used by System.Xml.XmlCharType.get_Instance() to initialize the charProperties pointer. That same resource is present in 3.5 as well, you could use it the same way.

Or take the lesser 3.5 approach:

WhitespaceChars = new char[] { ' ', '\t', '\n', '\r' };

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM