Shawn Weisfeld

I find when I talk to myself nobody listens. - Shawn Weisfeld
posts - 364, comments - 174, trackbacks - 34

My Links

News


Shawn Weisfeld's Facebook profile

The views expressed in this blog are mine and mine alone, not that of my employer, Microsoft, or anyone else’s. No warrantee is given for the quality of any material on this site.

Archives

Post Categories

April 2011 Entries

How to convert XML file in to a class file using c#?

  An oldie but a goodie. I like the technique that “arjay” outlined in his codeguru post (http://www.codeguru.com/forum/showthread.php?t=441772). However he noted a problem with the arrays that XSD.exe creates, namely you have to check for null every time you want to iterate over them. In the post he suggests hand editing the generated code. I am not a big fan of that. You can easily use a partial class to avoid needing to hand edit the code. Or you can use an extension method to encapsulate the check for you.   public static List<T> ToNonNullList<T>(this T[]...

posted @ Friday, April 1, 2011 7:53 PM | Feedback (0) |

Powered by: