Table of Contents

Method ComparisonBySize

Namespace
Alternet.UI
Assembly
Alternet.UI.Common.dll

ComparisonBySize(FileListBoxItem, FileListBoxItem)

Compares two FileListBoxItem objects based on their folder status, size, and text.

public static int ComparisonBySize(FileListBoxItem x, FileListBoxItem y)

Parameters

x FileListBoxItem

The first FileListBoxItem to compare. Can not be null.

y FileListBoxItem

The 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 x is less than y.
  • Zero if x is equal to y.
  • Greater than zero if x is greater than y.

Remarks

The comparison is performed in the following order:

  1. Folders are prioritized over non-folders.
  2. If both items are folders or both are non-folders, their sizes are compared. If the size is null, it is treated as 0.
  3. If the sizes are equal, their text values are compared using a case-insensitive ordinal comparison.