Select to view content in your preferred language

Passing geometries to the ITableSortCallBack

358
0
01-28-2017 01:05 AM
Status: Open
MaxMax2
Occasional Contributor II

In ArcObjects there is possibility to perform custom sorting using ITableSortCallBack:

public class CustomTableSort : ITableSortCallBack
{
    public int Compare(object value1, object value2, int fieldIndex, int fieldSortIndex)
    {
        // Do something
    }
}

ITableSort tableSort = new TableSortClass
{
    Table = ...,
    Fields = ...,
    Compare = new CustomTableSort()
};

But unfortunately geometries are not passed to the Compare method. So now there is no easy way to perform custom sort by some spatial criteria out-of-the-box. Developers need write their own sorting algorithms since they cannot use built-in ITableSort interface in this case. It would be great if this limitation of the ITableSortCallBack will be removed.