Glad you like them. :)

It's good to sometimes to do those small things that make things a little bit 
nicer, some other examples Guid.TryParse, Version.TryParse, Enum.TryParse, all 
new for .NET 4.0.

From: [email protected] [mailto:[email protected]] On 
Behalf Of Greg Keogh
Sent: Saturday, October 01, 2011 5:40 PM
To: 'ozDotNet'
Subject: In praise of DirectoryInfo Framework 4

Folks, I just found by accident that the following methods were added in 
Framework 4. They slipped in without any advertising that I saw:

DirectoryInfo.EnumerateDirectories<http://msdn.microsoft.com/en-us/library/system.io.directoryinfo.enumeratedirectories.aspx>
DirectoryInfo.EnumerateFiles<http://msdn.microsoft.com/en-us/library/system.io.directoryinfo.enumeratefiles.aspx>
DirectoryInfo.EnumerateFileSystemInfos<http://msdn.microsoft.com/en-us/library/dd383504.aspx>

These solve the miserable old problem with previous versions where you would 
block while the collections of results were loaded. I'm going to rejig some 
code and apps right now to take advantage of this.

Cheers,
Greg


Reply via email to