BetterExplorer.UsbEject.Volume.CompareTo C# (CSharp) Method

CompareTo() public method

Compares the current instance with another object of the same type.
public CompareTo ( object obj ) : int
obj object An object to compare with this instance.
return int
        public override int CompareTo(object obj)
        {
            Volume device = obj as Volume;
            if (device == null)
                throw new ArgumentException();

            if (LogicalDrive == null)
                return 1;

            if (device.LogicalDrive == null)
                return -1;

            return LogicalDrive.CompareTo(device.LogicalDrive);
        }
    }