Method ComparisonBySize
ComparisonBySize(FileListBoxItem, FileListBoxItem)
Compares two FileListBoxItem objects based on their folder status, size, and text.
public static int ComparisonBySize(FileListBoxItem x, FileListBoxItem y)
Parameters
xFileListBoxItemThe first FileListBoxItem to compare. Can not be
null.yFileListBoxItemThe second FileListBoxItem to compare. Can not be
null.
Returns
- int
A signed integer that indicates the relative order of the objects:
- Less than zero if
xis less thany. - Zero if
xis equal toy. - Greater than zero if
xis greater thany.
- Less than zero if
Remarks
The comparison is performed in the following order:
- Folders are prioritized over non-folders.
- If
both items are folders or both are non-folders, their sizes are compared. If the size
is
null, it is treated as 0. - If the sizes are equal, their text values are compared using a case-insensitive ordinal comparison.