DirectoryInfoExtensionsOrderByCreationTime Method
Sorts the elements of the source IEnumerableT by their CreationTime property.
Namespace: DevCase.Extensions.DirectoryInfoExtensionsAssembly: DevCase.net48 (in DevCase.net48.dll) Version: 6.0.0.0 (6.0)
XMLNS for XAML: Not mapped to an xmlns.
[EditorBrowsableAttribute(EditorBrowsableState.Always)]
public static IOrderedEnumerable<DirectoryInfo> OrderByCreationTime(
this IEnumerable<DirectoryInfo> sequence,
ListSortDirection sortDirection
)
<ExtensionAttribute>
<EditorBrowsableAttribute(EditorBrowsableState.Always)>
Public Shared Function OrderByCreationTime (
sequence As IEnumerable(Of DirectoryInfo),
sortDirection As ListSortDirection
) As IOrderedEnumerable(Of DirectoryInfo)
Dim sequence As IEnumerable(Of DirectoryInfo)
Dim sortDirection As ListSortDirection
Dim returnValue As IOrderedEnumerable(Of DirectoryInfo)
returnValue = sequence.OrderByCreationTime(sortDirection)
public:
[ExtensionAttribute]
[EditorBrowsableAttribute(EditorBrowsableState::Always)]
static IOrderedEnumerable<DirectoryInfo^>^ OrderByCreationTime(
IEnumerable<DirectoryInfo^>^ sequence,
ListSortDirection sortDirection
)
[<ExtensionAttribute>]
[<EditorBrowsableAttribute(EditorBrowsableState.Always)>]
static member OrderByCreationTime :
sequence : IEnumerable<DirectoryInfo> *
sortDirection : ListSortDirection -> IOrderedEnumerable<DirectoryInfo>
No code example is currently available or this language may not be supported.
- sequence IEnumerableDirectoryInfo
-
The source IEnumerableT.
- sortDirection ListSortDirection
-
A value that determine to sort the elements in ascending or descending order.
IOrderedEnumerableDirectoryInfo
The resulting
IEnumerableT.
In Visual Basic and C#, you can call this method as an instance method on any object of type
IEnumerableDirectoryInfo. When you use instance method syntax to call this method, omit the first parameter. For more information, see
Extension Methods (Visual Basic) or
Extension Methods (C# Programming Guide).
This is a code example.
No code example is currently available or this language may not be supported.
Dim dir As New DirectoryInfo("C:\Windows")
Dim dirs As IEnumerable(Of DirectoryInfo) = From dir As DirectoryInfo In dir.EnumerateDirectories("*", SearchOption.TopDirectoryOnly)
Dim sortedDirs As IOrderedEnumerable(Of DirectoryInfo) = IEnumerableExtensions.OrderByCreationTime(dirs, ListSortDirection.Ascending)
Dim formatProvider As IFormatProvider = CultureInfo.GetCultureInfo("es-ES").DateTimeFormat
For Each d As DirectoryInfo In sortedDirs
Console.WriteLine($"Creation Time: {d.CreationTime.ToString(formatProvider)}, Name: {d.Name}")
Next
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.