SearchRequestResult.Location Property
OBSOLETE
Due to changing Bing SOAP API to REST API, several options are not supported now. Please refer to the https://msdn.microsoft.com/en-us/library/cc980922.aspx topic to learn more.
Returns the location of a search result.
Namespace: DevExpress.Xpf.Map
Assembly: DevExpress.Xpf.Map.v24.1.dll
NuGet Package: DevExpress.Wpf.Map
Declaration
[Browsable(false)]
[Obsolete("Due to changing Bing SOAP API to REST API, several options are not supported now. Please refer to the https://msdn.microsoft.com/en-us/library/cc980922.aspx topic to learn more.")]
[PreferableMember("SearchRequestResult", "Location", "String")]
public string Location { get; }
Property Value
Type | Description |
---|---|
String | A String that is the name of a location contained in a search result. |
Example
Private Sub searchProvider_SearchCompleted(ByVal sender As Object, ByVal e As BingSearchCompletedEventArgs)
If e.Cancelled Then
Return
End If
If e.RequestResult.ResultCode <> RequestResultCode.Success Then
Return
End If
Dim sb As New StringBuilder()
Dim requestResult As SearchRequestResult = e.RequestResult
sb.Append(String.Format("Result Code: {0}" & vbLf, requestResult.ResultCode))
If String.IsNullOrEmpty(requestResult.FaultReason) Then
sb.Append(String.Format("Fault Reason: (none)" & vbLf, requestResult.FaultReason))
Else
sb.Append(String.Format("Fault Reason: {0}" & vbLf, requestResult.FaultReason))
End If
sb.Append(String.Format("Search Location: {0}" & vbLf, requestResult.Keyword))
sb.Append(String.Format("Estimated Matches: {0}" & vbLf, requestResult.EstimatedMatches))
sb.Append(String.Format("SearchResults:" & vbLf & "{0}", ProcessLocationList(requestResult.SearchResults)))
tbSearchResult.Text = sb.ToString()
End Sub
Private Function ProcessLocationList(ByVal results As List(Of LocationInformation)) As String
If results Is Nothing Then
Return ""
End If
Dim sb As New StringBuilder()
For i As Integer = 0 To results.Count - 1
sb.Append(String.Format("{0}) {1}", i + 1, ProcessLocationInformation(results(i))))
Next i
Return sb.ToString()
End Function
Private Function ProcessLocationInformation(ByVal info As LocationInformation) As String
If info Is Nothing Then
Return ""
End If
Dim sb As New StringBuilder()
sb.Append(String.Format("{0}" & vbLf, info.DisplayName))
sb.Append(String.Format(vbTab & "Adress: {0}" & vbLf, info.Address))
sb.Append(String.Format(vbTab & "Location: {0}" & vbLf, info.Location))
Return sb.ToString()
End Function
See Also