FileInfoExtensionsOrderByCreationTime Method
Sorts the elements of the source IEnumerableT by their CreationTime property.
Namespace: DevCase.Extensions.FileInfoExtensionsAssembly: 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<FileInfo> OrderByCreationTime(
this IEnumerable<FileInfo> sequence,
ListSortDirection sortDirection
)
<ExtensionAttribute>
<EditorBrowsableAttribute(EditorBrowsableState.Always)>
Public Shared Function OrderByCreationTime (
sequence As IEnumerable(Of FileInfo),
sortDirection As ListSortDirection
) As IOrderedEnumerable(Of FileInfo)
Dim sequence As IEnumerable(Of FileInfo)
Dim sortDirection As ListSortDirection
Dim returnValue As IOrderedEnumerable(Of FileInfo)
returnValue = sequence.OrderByCreationTime(sortDirection)
public:
[ExtensionAttribute]
[EditorBrowsableAttribute(EditorBrowsableState::Always)]
static IOrderedEnumerable<FileInfo^>^ OrderByCreationTime(
IEnumerable<FileInfo^>^ sequence,
ListSortDirection sortDirection
)
[<ExtensionAttribute>]
[<EditorBrowsableAttribute(EditorBrowsableState.Always)>]
static member OrderByCreationTime :
sequence : IEnumerable<FileInfo> *
sortDirection : ListSortDirection -> IOrderedEnumerable<FileInfo>
No code example is currently available or this language may not be supported.
- sequence IEnumerableFileInfo
-
The source IEnumerableT.
- sortDirection ListSortDirection
-
A value that determine to sort the elements in ascending or descending order.
IOrderedEnumerableFileInfo
The resulting
IEnumerableT.
In Visual Basic and C#, you can call this method as an instance method on any object of type
IEnumerableFileInfo. 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 files As IEnumerable(Of FileInfo) = From fi As FileInfo In dir.EnumerateFiles("*", SearchOption.TopDirectoryOnly)
Dim sortedFiles As IOrderedEnumerable(Of FileInfo) = IEnumerableExtensions.OrderByCreationTime(files, ListSortDirection.Ascending)
Dim formatProvider As IFormatProvider = CultureInfo.GetCultureInfo("es-ES").DateTimeFormat
For Each file As FileInfo In sortedFiles
Console.WriteLine($"Creation Time: {file.CreationTime.ToString(formatProvider)}, Name: {file.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.