IdentifyLayerResult does not maintain the same order of the attributes of the GeoElement as in the geodatabase.
上次发布: June 29, 2018ArcGIS Runtime SDK
漏洞 ID 编号
BUG-000112996
已提交
April 5, 2018
上次修改时间
June 5, 2024
适用范围
ArcGIS Runtime SDK
找到的版本
100.2.0
操作系统
Windows OS
操作系统版本
10.0 64 Bit
状态
Will Not Be Addressed
开发团队已考虑过该问题或请求,并决定不会解决该问题。 问题的“其他信息”部分可能包含进一步说明。
附加信息
The current behavior is by-design: the order of keys in a dictionary is not guaranteed in .NET.
For more information see https://docs.microsoft.com/en-us/dotnet/api/system.collections.generic.dictionary-2?view=netframework-4.7.1#remarks
"For purposes of enumeration, each item in the dictionary is treated as a KeyValuePair structure representing a value and its key. The order in which the items are returned is undefined."
Instead, if the data should be presented to the user in a specific order, then the field attribute values should be requested by Key. For example the BUG reproducer code can be modified:
```
foreach (var geoelement in result.GeoElements)
{
foreach (var field in ((FeatureLayer)result.LayerContent).FeatureTable.Fields)
{
Debug.WriteLine(string.Format("{0}: ",field.Name) + geoelement.Attributes[field.Name]?.ToString());
}
}
```