{
//Within QueuedTask.Run()
if (featureLayer.GetIsFeatureDrawOrderSupported())
{
var listOfSortInfo = new List<CIMFeatureSortInfo>
{
//Draw features in the layer ordered by Police_Precinct field in ascending order
//and then by Crime_rate field in descending order
new CIMFeatureSortInfo
{
FieldName = "Police_Precinct",
SortDirection = SortOrderType.Ascending
},
new CIMFeatureSortInfo
{
FieldName = "Crime_rate",
SortDirection = SortOrderType.Descending
}
};
//Provide the list of FSOs to use and their sort ordering
//All fields must exist on the layer.
if (featureLayer.GetCanSetFeatureDrawOrder(listOfSortInfo))
{
//Set the FDO to use the list of FSOs
featureLayer.SetFeatureDrawOrder(listOfSortInfo);
}
}
}