Game.UI.Editor.FileItem
Assembly:
Assembly-CSharp
Namespace:
Game.UI.Editor
Type:
class
Base:
System.Object; Implements: IItemPicker.Item, System.IComparable
Summary:
Represents a simple file entry used by an item picker UI. Exposes a single string property "path" and provides an ordinal comparison implementation so FileItem instances can be sorted by their path.
Fields
None
This class does not declare any private or public fields; it relies on an auto-implemented property.
Properties
public string path { get; set; }
Holds the file path (display/identifier) for this item. The value may be null if not set. This property is used by CompareTo to determine ordering.
Constructors
public FileItem()
No explicit constructor is defined in source; the default parameterless constructor is provided by the compiler. Typical usage is to set the path property after construction (e.g., new FileItem { path = "..." }).
Methods
public int CompareTo(FileItem other)
Compares this FileItem to another by performing a string.CompareOrdinal between this.path and other.path. Notes:- If other is null, accessing other.path will throw a NullReferenceException (the current implementation does not guard against a null argument).
- If other is non-null but either path is null, string.CompareOrdinal handles nulls (null is considered less than a non-null string).
- Comparison is ordinal (binary) and culture-insensitive.
- Use case: sorting lists or collections of FileItem instances.
Usage Example
var itemA = new FileItem { path = "Assets/Textures/brick.png" };
var itemB = new FileItem { path = "Assets/Models/car.fbx" };
var items = new List<FileItem> { itemB, itemA };
items.Sort(); // Uses FileItem.CompareTo to order by the 'path' string