Omer Raviv
Omer Raviv

Reputation: 11827

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?

Upvotes: 2

Views: 288

Answers (1)

Hans Passant
Hans Passant

Reputation: 942227

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' };

Upvotes: 4

Related Questions