一、使用FeatureLayer判断要素类的字段是否存在
Private Async Function AddField(pFeatureLayer As FeatureLayer) As Task(Of Boolean)
Dim b = False
Dim dict As List(Of FieldDescription) = pFeatureLayer.GetFieldDescriptions
Dim cctt = dict.FindAll(Function(t) t.Name = name)
If cctt.Count = 0 Then
b = True
End If
Return (b)
End Function
二、使用featureClass判断要素类的字段是否存在
Private Async Function AddField(pfeatureClass As featureClass) As Task(Of Boolean)
If pfeatureClass.GetDefinition.FindField("X") = -1 Then
Return (false)
End If
End Function