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:
<ul><li>Less than zero if <code class="paramref">x</code> is less than <code class="paramref">y</code>.</li><li>Zero if <code class="paramref">x</code> is equal to <code class="paramref">y</code>.</li><li>Greater than zero if <code class="paramref">x</code> is greater than <code class="paramref">y</code>.</li></ul>
Remarks
The comparison is performed in the following order:
<ol><li>Folders are prioritized over non-folders.</li><li>If
both items are folders or both are non-folders, their sizes are compared. If the size
is <code>null</code>, it
is treated as 0.</li><li>If the sizes are equal,
their text values are
compared using a case-insensitive ordinal comparison.</li></ol>