Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion Readme.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<!-- default badges list -->
![](https://img.shields.io/endpoint?url=https://codecentral.devexpress.com/api/v1/VersionRange/128571708/25.1.3%2B)
[![](https://img.shields.io/badge/Open_in_DevExpress_Support_Center-FF7200?style=flat-square&logo=DevExpress&logoColor=white)](https://supportcenter.devexpress.com/ticket/details/T189413)
[![](https://img.shields.io/badge/📖_How_to_use_DevExpress_Examples-e9f6fc?style=flat-square)](https://docs.devexpress.com/GeneralInformation/403183)
[![](https://img.shields.io/badge/💬_Leave_Feedback-feecdd?style=flat-square)](#does-this-example-address-your-development-requirementsobjectives)
Expand Down
2 changes: 1 addition & 1 deletion VB/MapControl_SearchPanel/App.config
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
Expand Down
3 changes: 2 additions & 1 deletion VB/MapControl_SearchPanel/App.xaml.vb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
Imports System.Windows
Imports System.Linq
Imports System.Threading.Tasks

Namespace MapControl_SearchPanel

Expand Down
3 changes: 1 addition & 2 deletions VB/MapControl_SearchPanel/MainWindow.xaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<Window xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
<Window xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:sys="clr-namespace:System;assembly=mscorlib"
xmlns:local="clr-namespace:MapControl_SearchPanel"
Expand Down
53 changes: 25 additions & 28 deletions VB/MapControl_SearchPanel/MainWindow.xaml.vb
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
Imports DevExpress.Xpf.Map
Imports System.Collections.Generic
Imports System.Globalization
Imports System.Text
Imports System.Windows
Imports System.Windows.Controls

Namespace MapControl_SearchPanel
Expand All @@ -11,60 +8,60 @@ Namespace MapControl_SearchPanel
Inherits Window

Public Sub New()
Me.InitializeComponent()
InitializeComponent()
End Sub

'#Region "#CustomSearch"
#Region "#CustomSearch"
Private Sub bSearch_Click(ByVal sender As Object, ByVal e As RoutedEventArgs)
Me.tbSearchResult.Text = ""
Me.searchProvider.Search(Me.tbLocation.Text)
tbSearchResult.Text = ""
searchProvider.Search(tbLocation.Text)
End Sub

'#End Region ' #CustomSearch
#End Region ' #CustomSearch
Private Sub ValidationError(ByVal sender As Object, ByVal e As ValidationErrorEventArgs)
If e.Action = ValidationErrorEventAction.Added Then Call MessageBox.Show(e.Error.ErrorContent.ToString())
If e.Action Is ValidationErrorEventAction.Added Then MessageBox.Show(e.[Error].ErrorContent.ToString())
End Sub

'#Region "#SearchCompletedEventHandler"
#Region "#SearchCompletedEventHandler"
Private Sub searchProvider_SearchCompleted(ByVal sender As Object, ByVal e As AzureSearchCompletedEventArgs)
If e.Cancelled Then Return
If e.RequestResult.ResultCode <> RequestResultCode.Success Then Return
If e.RequestResult.ResultCode IsNot RequestResultCode.Success Then Return
Dim sb As StringBuilder = New StringBuilder()
Dim requestResult As SearchRequestResult = e.RequestResult
sb.Append(String.Format("Result Code: {0}" & Microsoft.VisualBasic.Constants.vbLf, requestResult.ResultCode))
If String.IsNullOrEmpty(requestResult.FaultReason) Then
sb.Append(String.Format("Fault Reason: (none)" & Microsoft.VisualBasic.Constants.vbLf, requestResult.FaultReason))
sb.Append([String].Format("Result Code: {0}" & Microsoft.VisualBasic.Constants.vbLf, requestResult.ResultCode))
If [String].IsNullOrEmpty(requestResult.FaultReason) Then
sb.Append([String].Format("Fault Reason: (none)" & Microsoft.VisualBasic.Constants.vbLf, requestResult.FaultReason))
Else
sb.Append(String.Format("Fault Reason: {0}" & Microsoft.VisualBasic.Constants.vbLf, requestResult.FaultReason))
sb.Append([String].Format("Fault Reason: {0}" & Microsoft.VisualBasic.Constants.vbLf, requestResult.FaultReason))
End If

sb.Append(String.Format("Search Location: {0}" & Microsoft.VisualBasic.Constants.vbLf, requestResult.Keyword))
sb.Append(String.Format("Estimated Matches: {0}" & Microsoft.VisualBasic.Constants.vbLf, requestResult.EstimatedMatches))
sb.Append(String.Format("SearchResults:" & Microsoft.VisualBasic.Constants.vbLf & "{0}", ProcessLocationList(requestResult.SearchResults)))
Me.tbSearchResult.Text = sb.ToString()
sb.Append([String].Format("Search Location: {0}" & Microsoft.VisualBasic.Constants.vbLf, requestResult.Keyword))
sb.Append([String].Format("Estimated Matches: {0}" & Microsoft.VisualBasic.Constants.vbLf, requestResult.EstimatedMatches))
sb.Append([String].Format("SearchResults:" & Microsoft.VisualBasic.Constants.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 ""
Dim sb As StringBuilder = New StringBuilder()
For i As Integer = 0 To results.Count - 1
sb.Append(String.Format("{0}) {1}", i + 1, ProcessLocationInformation(results(i))))
sb.Append([String].Format("{0}) {1}", i + 1, ProcessLocationInformation(results(i))))
Next

Return sb.ToString()
End Function

'#End Region ' #SearchCompletedEventHandler
'#Region "#ProcessLocationInformation"
#End Region ' #SearchCompletedEventHandler
#Region "#ProcessLocationInformation"
Private Function ProcessLocationInformation(ByVal info As LocationInformation) As String
If info Is Nothing Then Return ""
Dim sb As StringBuilder = New StringBuilder()
sb.Append(String.Format("{0}" & Microsoft.VisualBasic.Constants.vbLf, info.DisplayName))
sb.Append(String.Format(Microsoft.VisualBasic.Constants.vbTab & "Adress: {0}" & Microsoft.VisualBasic.Constants.vbLf, info.Address))
sb.Append(String.Format(Microsoft.VisualBasic.Constants.vbTab & "Location: {0}" & Microsoft.VisualBasic.Constants.vbLf, info.Location))
sb.Append([String].Format("{0}" & Microsoft.VisualBasic.Constants.vbLf, info.DisplayName))
sb.Append([String].Format(Microsoft.VisualBasic.Constants.vbTab & "Adress: {0}" & Microsoft.VisualBasic.Constants.vbLf, info.Address))
sb.Append([String].Format(Microsoft.VisualBasic.Constants.vbTab & "Location: {0}" & Microsoft.VisualBasic.Constants.vbLf, info.Location))
Return sb.ToString()
End Function
'#End Region ' #ProcessLocationInformation
#End Region ' #ProcessLocationInformation
End Class

Friend Class NonNegativeIntValidationRule
Expand All @@ -86,13 +83,13 @@ Namespace MapControl_SearchPanel
End Get

Set(ByVal value As Integer)
If value <> maxField Then maxField = value
If value IsNot maxField Then maxField = value
End Set
End Property

Public Overrides Function Validate(ByVal value As Object, ByVal cultureInfo As CultureInfo) As ValidationResult
Dim i As Integer
If Not Integer.TryParse(TryCast(value, String), NumberStyles.Integer, cultureInfo, i) Then Return New ValidationResult(False, "Input value should be an integer.")
If Not Integer.TryParse(TryCast(value, String), NumberStyles.[Integer], cultureInfo, i) Then Return New ValidationResult(False, "Input value should be an integer.")
If i > maxField OrElse i < minField Then Return New ValidationResult(False, String.Format("Input value should be larger than or equals to 0 and les than or equals to {0}", maxField))
Return New ValidationResult(True, Nothing)
End Function
Expand Down
35 changes: 18 additions & 17 deletions VB/MapControl_SearchPanel/MapControl_SearchPanel.Net5.vbproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
<OptionInfer>On</OptionInfer>
<TargetFramework>net8.0-windows</TargetFramework>
<OutputType>WinExe</OutputType>
<RootNamespace></RootNamespace>
<RootNamespace>
</RootNamespace>
<AssemblyName>MapControl_SearchPanel</AssemblyName>
<GenerateAssemblyInfo>true</GenerateAssemblyInfo>
<GenerateAssemblyVersionAttribute>false</GenerateAssemblyVersionAttribute>
Expand Down Expand Up @@ -33,20 +34,20 @@
<AppDesigner Include="Properties\" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="DevExpress.Data" Version="25.1.4-pre-25181" />
<PackageReference Include="DevExpress.Data.Desktop" Version="25.1.4-pre-25181" />
<PackageReference Include="DevExpress.Map.Core" Version="25.1.4-pre-25181" />
<PackageReference Include="DevExpress.Mvvm" Version="25.1.4-pre-25181" />
<PackageReference Include="DevExpress.Office.Core" Version="25.1.4-pre-25181" />
<PackageReference Include="DevExpress.Pdf.Core" Version="25.1.4-pre-25181" />
<PackageReference Include="DevExpress.Printing.Core" Version="25.1.4-pre-25181" />
<PackageReference Include="DevExpress.RichEdit.Core" Version="25.1.4-pre-25181" />
<PackageReference Include="DevExpress.RichEdit.Export" Version="25.1.4-pre-25181" />
<PackageReference Include="DevExpress.Wpf.Core" Version="25.1.4-pre-25181" />
<PackageReference Include="DevExpress.Wpf.LayoutControl" Version="25.1.4-pre-25181" />
<PackageReference Include="DevExpress.Wpf.Map" Version="25.1.4-pre-25181" />
<PackageReference Include="DevExpress.Wpf.Printing" Version="25.1.4-pre-25181" />
<PackageReference Include="DevExpress.Wpf.Reporting" Version="25.1.4-pre-25181" />
<PackageReference Include="DevExpress.Wpf.Themes.All" Version="25.1.4-pre-25181" />
<PackageReference Include="DevExpress.Data" Version="25.1.3" />
<PackageReference Include="DevExpress.Data.Desktop" Version="25.1.3" />
<PackageReference Include="DevExpress.Map.Core" Version="25.1.3" />
<PackageReference Include="DevExpress.Mvvm" Version="25.1.3" />
<PackageReference Include="DevExpress.Office.Core" Version="25.1.3" />
<PackageReference Include="DevExpress.Pdf.Core" Version="25.1.3" />
<PackageReference Include="DevExpress.Printing.Core" Version="25.1.3" />
<PackageReference Include="DevExpress.RichEdit.Core" Version="25.1.3" />
<PackageReference Include="DevExpress.RichEdit.Export" Version="25.1.3" />
<PackageReference Include="DevExpress.Wpf.Core" Version="25.1.3" />
<PackageReference Include="DevExpress.Wpf.LayoutControl" Version="25.1.3" />
<PackageReference Include="DevExpress.Wpf.Map" Version="25.1.3" />
<PackageReference Include="DevExpress.Wpf.Printing" Version="25.1.3" />
<PackageReference Include="DevExpress.Wpf.Reporting" Version="25.1.3" />
<PackageReference Include="DevExpress.Wpf.Themes.All" Version="25.1.3" />
</ItemGroup>
</Project>
</Project>
3 changes: 1 addition & 2 deletions VB/MapControl_SearchPanel/Properties/AssemblyInfo.vb
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
Imports System.Reflection
Imports System.Runtime.InteropServices
Imports System.Windows
Imports System.Resources

' General Information about an assembly is controlled through the following
' set of attributes. Change these attribute values to modify the information
Expand Down