Method ComparisonByText
ComparisonByText(FileListBoxItem, FileListBoxItem)
Compares two FileListBoxItem objects based on their folder status and text values.
public static int ComparisonByText(FileListBoxItem x, FileListBoxItem y)
Parameters
xFileListBoxItemThe first FileListBoxItem to compare. Cannot be
null.yFileListBoxItemThe second FileListBoxItem to compare. Cannot be
null.
Returns
- int
A signed integer that indicates the relative order of the objects being compared:
- Less than zero if
xprecedesy. - Zero if
xandyare equal. - Greater than zero if
xfollowsy.
- Less than zero if
Remarks
The comparison prioritizes folder status, ensuring folders are ordered before non-folders. If both items have the same folder status, their Text values are compared using a case-insensitive, ordinal string comparison.