jj 02.12.16 frmGeodataSelect

This commit is contained in:
JenneJ 2016-12-02 14:33:55 +01:00
parent 57517ffed8
commit 29abb10c1b
6 changed files with 495 additions and 33 deletions

View File

@ -310,6 +310,12 @@
<Compile Include="frmGeodataNavigation.vb">
<SubType>Form</SubType>
</Compile>
<Compile Include="frmGeodataSelect.Designer.vb">
<DependentUpon>frmGeodataSelect.vb</DependentUpon>
</Compile>
<Compile Include="frmGeodataSelect.vb">
<SubType>Form</SubType>
</Compile>
<Compile Include="frmLicense_User.Designer.vb">
<DependentUpon>frmLicense_User.vb</DependentUpon>
</Compile>
@ -741,6 +747,9 @@
<EmbeddedResource Include="frmGeodataNavigation.resx">
<DependentUpon>frmGeodataNavigation.vb</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="frmGeodataSelect.resx">
<DependentUpon>frmGeodataSelect.vb</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="frmLicense.en-US.resx">
<DependentUpon>frmLicense.vb</DependentUpon>
</EmbeddedResource>

View File

@ -35,8 +35,8 @@ Partial Class frmGeodataNavigation
Me.SplitContainer1 = New System.Windows.Forms.SplitContainer()
Me.GridControlGeo = New DevExpress.XtraGrid.GridControl()
Me.grvwMain = New DevExpress.XtraGrid.Views.Grid.GridView()
Me.Button2 = New System.Windows.Forms.Button()
Me.Button1 = New System.Windows.Forms.Button()
Me.btnSave = New System.Windows.Forms.Button()
Me.btnOpenMap = New System.Windows.Forms.Button()
Me.Label2 = New System.Windows.Forms.Label()
Me.Label1 = New System.Windows.Forms.Label()
Me.txtLon = New System.Windows.Forms.TextBox()
@ -128,15 +128,15 @@ Partial Class frmGeodataNavigation
'
'SplitContainer1.Panel2
'
Me.SplitContainer1.Panel2.Controls.Add(Me.Button2)
Me.SplitContainer1.Panel2.Controls.Add(Me.Button1)
Me.SplitContainer1.Panel2.Controls.Add(Me.btnSave)
Me.SplitContainer1.Panel2.Controls.Add(Me.btnOpenMap)
Me.SplitContainer1.Panel2.Controls.Add(Me.Label2)
Me.SplitContainer1.Panel2.Controls.Add(Me.Label1)
Me.SplitContainer1.Panel2.Controls.Add(Me.txtLon)
Me.SplitContainer1.Panel2.Controls.Add(Me.txtLat)
Me.SplitContainer1.Panel2MinSize = 100
Me.SplitContainer1.Size = New System.Drawing.Size(996, 572)
Me.SplitContainer1.SplitterDistance = 467
Me.SplitContainer1.SplitterDistance = 411
Me.SplitContainer1.TabIndex = 0
'
'GridControlGeo
@ -145,38 +145,50 @@ Partial Class frmGeodataNavigation
Me.GridControlGeo.Location = New System.Drawing.Point(0, 0)
Me.GridControlGeo.MainView = Me.grvwMain
Me.GridControlGeo.Name = "GridControlGeo"
Me.GridControlGeo.Size = New System.Drawing.Size(996, 467)
Me.GridControlGeo.Size = New System.Drawing.Size(996, 411)
Me.GridControlGeo.TabIndex = 0
Me.GridControlGeo.ViewCollection.AddRange(New DevExpress.XtraGrid.Views.Base.BaseView() {Me.grvwMain})
'
'grvwMain
'
Me.grvwMain.Appearance.EvenRow.BackColor = System.Drawing.Color.Aqua
Me.grvwMain.Appearance.EvenRow.Options.UseBackColor = True
Me.grvwMain.GridControl = Me.GridControlGeo
Me.grvwMain.Name = "grvwMain"
Me.grvwMain.OptionsBehavior.Editable = False
Me.grvwMain.OptionsBehavior.ReadOnly = True
Me.grvwMain.OptionsSelection.EnableAppearanceFocusedCell = False
Me.grvwMain.OptionsSelection.EnableAppearanceFocusedRow = False
Me.grvwMain.OptionsSelection.EnableAppearanceHideSelection = False
Me.grvwMain.OptionsSelection.MultiSelect = True
Me.grvwMain.OptionsSelection.MultiSelectMode = DevExpress.XtraGrid.Views.Grid.GridMultiSelectMode.CellSelect
Me.grvwMain.OptionsView.ColumnAutoWidth = False
Me.grvwMain.OptionsView.EnableAppearanceEvenRow = True
Me.grvwMain.OptionsView.ShowHorizontalLines = DevExpress.Utils.DefaultBoolean.[True]
'
'Button2
'btnSave
'
Me.Button2.Location = New System.Drawing.Point(467, 25)
Me.Button2.Name = "Button2"
Me.Button2.Size = New System.Drawing.Size(96, 49)
Me.Button2.TabIndex = 5
Me.Button2.Text = "Save"
Me.Button2.UseVisualStyleBackColor = True
Me.btnSave.Location = New System.Drawing.Point(379, 96)
Me.btnSave.Name = "btnSave"
Me.btnSave.Size = New System.Drawing.Size(96, 33)
Me.btnSave.TabIndex = 5
Me.btnSave.Text = "Save"
Me.btnSave.UseVisualStyleBackColor = True
'
'Button1
'
Me.Button1.Location = New System.Drawing.Point(365, 25)
Me.Button1.Name = "Button1"
Me.Button1.Size = New System.Drawing.Size(96, 49)
Me.Button1.TabIndex = 4
Me.Button1.Text = "Set on Map"
Me.Button1.UseVisualStyleBackColor = True
Me.btnOpenMap.Location = New System.Drawing.Point(277, 96)
Me.btnOpenMap.Name = "Button1"
Me.btnOpenMap.Size = New System.Drawing.Size(96, 33)
Me.btnOpenMap.TabIndex = 4
Me.btnOpenMap.Text = "Set on Map"
Me.btnOpenMap.UseVisualStyleBackColor = True
'
'Label2
'
Me.Label2.AutoSize = True
Me.Label2.Font = New System.Drawing.Font("Tahoma", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Label2.Location = New System.Drawing.Point(164, 22)
Me.Label2.Location = New System.Drawing.Point(8, 77)
Me.Label2.Name = "Label2"
Me.Label2.Size = New System.Drawing.Size(68, 16)
Me.Label2.TabIndex = 3
@ -195,9 +207,10 @@ Partial Class frmGeodataNavigation
'txtLon
'
Me.txtLon.Font = New System.Drawing.Font("Tahoma", 15.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.txtLon.Location = New System.Drawing.Point(167, 41)
Me.txtLon.Location = New System.Drawing.Point(11, 96)
Me.txtLon.Name = "txtLon"
Me.txtLon.Size = New System.Drawing.Size(150, 33)
Me.txtLon.ReadOnly = True
Me.txtLon.Size = New System.Drawing.Size(260, 33)
Me.txtLon.TabIndex = 1
'
'txtLat
@ -205,7 +218,8 @@ Partial Class frmGeodataNavigation
Me.txtLat.Font = New System.Drawing.Font("Tahoma", 15.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.txtLat.Location = New System.Drawing.Point(11, 41)
Me.txtLat.Name = "txtLat"
Me.txtLat.Size = New System.Drawing.Size(150, 33)
Me.txtLat.ReadOnly = True
Me.txtLat.Size = New System.Drawing.Size(260, 33)
Me.txtLat.TabIndex = 0
'
'frmGeodataNavigation
@ -252,6 +266,6 @@ Partial Class frmGeodataNavigation
Friend WithEvents Label1 As System.Windows.Forms.Label
Friend WithEvents txtLon As System.Windows.Forms.TextBox
Friend WithEvents txtLat As System.Windows.Forms.TextBox
Friend WithEvents Button2 As System.Windows.Forms.Button
Friend WithEvents Button1 As System.Windows.Forms.Button
Friend WithEvents btnSave As System.Windows.Forms.Button
Friend WithEvents btnOpenMap As System.Windows.Forms.Button
End Class

View File

@ -1,5 +1,8 @@
Imports DevExpress.XtraMap
Imports DevExpress.XtraEditors
Imports DevExpress.XtraGrid
Imports DevExpress.Utils
Imports DevExpress.XtraGrid.Columns
Public Class frmGeodataNavigation
@ -7,6 +10,7 @@ Public Class frmGeodataNavigation
Private EntityId As Integer = Nothing
Private EntitySql As String = Nothing
Private Grid As GridControl = Nothing
Private CurrentPoint As GeoPoint = Nothing
Private ReadOnly Property ImageLayer() As ImageTilesLayer
Get
@ -85,7 +89,7 @@ Public Class frmGeodataNavigation
gridView.ActiveFilterString = Nothing
Catch ex As Exception
MsgBox("Error in frmGeodataNavigation_FormClosing: " & vbNewLine & ex.Message)
End Try
End Try
End Sub
Private Sub frmGeodataNavigation_Load(sender As Object, e As EventArgs) Handles MyBase.Load
@ -101,6 +105,42 @@ Public Class frmGeodataNavigation
Dim DT_GEO As DataTable = ClassDatabase.Return_Datatable(sql)
GridControlGeo.DataSource = DT_GEO
End If
Dim listcheck As List(Of String) = ClassHelper.Return_listcheck(CURRENT_FORM_ID)
Dim listdate As List(Of String) = ClassHelper.Return_listdate(CURRENT_FORM_ID)
For Each col As String In listdate
Dim date_edit As New DevExpress.XtraEditors.Repository.RepositoryItemTimeEdit
Dim date_column As GridColumn = grvwMain.Columns(col)
date_column.DisplayFormat.FormatType = FormatType.DateTime
date_column.DisplayFormat.FormatString = CURRENT_DATE_FORMAT
date_column.OptionsFilter.FilterPopupMode = FilterPopupMode.Date
date_column.ColumnEdit = date_edit
date_column.FilterMode = ColumnFilterMode.Value ' was DisplayText
date_edit.DisplayFormat.FormatType = FormatType.DateTime
date_edit.DisplayFormat.FormatString = CURRENT_DATE_FORMAT
date_edit.Mask.MaskType = Mask.MaskType.DateTime
date_edit.Mask.EditMask = CURRENT_DATE_FORMAT
date_edit.Mask.UseMaskAsDisplayFormat = True
Next
' Styles for GridControl
grvwMain.FocusRectStyle = DevExpress.XtraGrid.Views.Grid.DrawFocusRectStyle.None
grvwMain.OptionsBehavior.Editable = False
grvwMain.OptionsSelection.EnableAppearanceFocusedCell = False
grvwMain.OptionsSelection.EnableAppearanceFocusedRow = False
grvwMain.OptionsSelection.EnableAppearanceHideSelection = False
grvwMain.Columns("AddedWhen").DisplayFormat.FormatType = FormatType.DateTime
grvwMain.Columns("AddedWhen").DisplayFormat.FormatString = CURRENT_DATE_FORMAT & " HH:MM:ss"
grvwMain.Columns("ChangedWhen").DisplayFormat.FormatType = FormatType.DateTime
grvwMain.Columns("ChangedWhen").DisplayFormat.FormatString = CURRENT_DATE_FORMAT & " HH:MM:ss"
grvwMain.Columns("Record-ID").Visible = False
grvwMain.Columns("Form-ID").Visible = False
grvwMain.Columns("ROW_COLOR").Visible = False
Catch ex As Exception
MsgBox("Error while loading GeoData: " & vbNewLine & ex.Message)
End Try
@ -147,21 +187,96 @@ Public Class frmGeodataNavigation
End Class
Private Sub XtraTabControl1_TabIndexChanged(sender As Object, e As EventArgs) Handles XtraTabControl1.TabIndexChanged
End Sub
Private Sub grvwMain_RowStyle(sender As Object, e As Views.Grid.RowStyleEventArgs) Handles grvwMain.RowStyle
'TODO: Make Rows without geodata RED
If e.RowHandle <> -1 Then
Dim row As DataRowView = grvwMain.GetRow(e.RowHandle)
Dim LATITUDE = row.Item("LATITUDE")
Dim LONGITUDE = row.Item("LONGITUDE")
If LATITUDE Is Nothing Or LONGITUDE Is Nothing Then
e.Appearance.BackColor = Color.Red
End If
End If
End Sub
Private Sub grvwMain_FocusedRowChanged(sender As Object, e As Views.Base.FocusedRowChangedEventArgs) Handles grvwMain.FocusedRowChanged
'TODO: Load LatLon in Splitter2
Dim currentRow As DataRowView = grvwMain.GetFocusedRow()
Dim lat As Decimal = currentRow.Item("LATITUDE")
Dim lon As Decimal = currentRow.Item("LONGITUDE")
Dim lat, lon As Decimal
txtLat.Text = lat
txtLon.Text = lon
Try
lat = currentRow.Item("LATITUDE")
lon = currentRow.Item("LONGITUDE")
Catch ex As InvalidCastException
lat = -1
lon = -1
End Try
If lat = -1 And lon = -1 Then
txtLat.Text = String.Empty
txtLon.Text = String.Empty
CurrentPoint = Nothing
Else
txtLat.Text = lat
txtLon.Text = lon
CurrentPoint = New GeoPoint(lat, lon)
End If
End Sub
Private Sub btnOpenMap_Click(sender As Object, e As EventArgs) Handles btnOpenMap.Click
Dim lat, lon As Double
Dim point As GeoPoint
Try
lat = Double.Parse(txtLat.Text)
lon = Double.Parse(txtLon.Text)
point = New GeoPoint(lat, lon)
Catch ex As Exception
point = Nothing
Finally
Dim frm As New frmGeodataSelect(point)
Dim result = frm.ShowDialog()
If result = Windows.Forms.DialogResult.OK Then
Dim SelectedPoint As GeoPoint = frm.SelectedPoint
txtLat.Text = SelectedPoint.Latitude
txtLon.Text = SelectedPoint.Longitude
CurrentPoint = SelectedPoint
End If
End Try
End Sub
Private Sub btnSave_Click(sender As Object, e As EventArgs) Handles btnSave.Click
If CurrentPoint Is Nothing Then
MsgBox("Es wurden keine Koodinaten angegeben!", MsgBoxStyle.Critical)
Exit Sub
End If
Try
Dim lat As Decimal = CurrentPoint.Latitude
Dim lon As Decimal = CurrentPoint.Longitude
Dim currentRow As DataRowView = grvwMain.GetFocusedRow()
Dim RecordId As Integer = currentRow.Item("Record-ID")
Dim SQL As String = "UPDATE TBPMO_RECORD_GEODATA SET LATITUDE = @lat, LONGITUDE = @lon, CHANGED_WHO = @who WHERE RECORD_ID = @recordid"
Dim conn As SqlClient.SqlConnection = New SqlClient.SqlConnection(MyConnectionString)
Dim cmd As SqlClient.SqlCommand = New SqlClient.SqlCommand(SQL, conn)
cmd.Parameters.Add("@lat", SqlDbType.Decimal).Value = lat
cmd.Parameters.Add("@lon", SqlDbType.Decimal).Value = lon
cmd.Parameters.Add("@who", SqlDbType.VarChar).Value = Environment.UserName
cmd.Parameters.Add("@recordid", SqlDbType.Int).Value = RecordId
conn.Open()
cmd.ExecuteNonQuery()
conn.Close()
Catch ex As Exception
MsgBox("Error while saving Coordinates: " & vbNewLine & ex.Message)
End Try
End Sub
End Class

View File

@ -0,0 +1,125 @@
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Partial Class frmGeodataSelect
Inherits System.Windows.Forms.Form
'Das Formular überschreibt den Löschvorgang, um die Komponentenliste zu bereinigen.
<System.Diagnostics.DebuggerNonUserCode()> _
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
Try
If disposing AndAlso components IsNot Nothing Then
components.Dispose()
End If
Finally
MyBase.Dispose(disposing)
End Try
End Sub
'Wird vom Windows Form-Designer benötigt.
Private components As System.ComponentModel.IContainer
'Hinweis: Die folgende Prozedur ist für den Windows Form-Designer erforderlich.
'Das Bearbeiten ist mit dem Windows Form-Designer möglich.
'Das Bearbeiten mit dem Code-Editor ist nicht möglich.
<System.Diagnostics.DebuggerStepThrough()> _
Private Sub InitializeComponent()
Dim ImageTilesLayer2 As DevExpress.XtraMap.ImageTilesLayer = New DevExpress.XtraMap.ImageTilesLayer()
Dim VectorItemsLayer2 As DevExpress.XtraMap.VectorItemsLayer = New DevExpress.XtraMap.VectorItemsLayer()
Me.ToolStrip1 = New System.Windows.Forms.ToolStrip()
Me.btnSave = New System.Windows.Forms.ToolStripButton()
Me.ToolStripLabel1 = New System.Windows.Forms.ToolStripLabel()
Me.ToolStripLabel2 = New System.Windows.Forms.ToolStripLabel()
Me.txtLat = New System.Windows.Forms.ToolStripLabel()
Me.ToolStripLabel4 = New System.Windows.Forms.ToolStripLabel()
Me.txtLon = New System.Windows.Forms.ToolStripLabel()
Me.MapControl1 = New DevExpress.XtraMap.MapControl()
Me.ToolStrip1.SuspendLayout()
CType(Me.MapControl1, System.ComponentModel.ISupportInitialize).BeginInit()
Me.SuspendLayout()
'
'ToolStrip1
'
Me.ToolStrip1.GripStyle = System.Windows.Forms.ToolStripGripStyle.Hidden
Me.ToolStrip1.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.btnSave, Me.ToolStripLabel1, Me.ToolStripLabel2, Me.txtLat, Me.ToolStripLabel4, Me.txtLon})
Me.ToolStrip1.Location = New System.Drawing.Point(0, 0)
Me.ToolStrip1.Name = "ToolStrip1"
Me.ToolStrip1.Size = New System.Drawing.Size(882, 25)
Me.ToolStrip1.TabIndex = 0
Me.ToolStrip1.Text = "ToolStrip1"
'
'btnSave
'
Me.btnSave.Alignment = System.Windows.Forms.ToolStripItemAlignment.Right
Me.btnSave.Image = Global.DD_Record_Organiser.My.Resources.Resources.save_16xLG1
Me.btnSave.ImageTransparentColor = System.Drawing.Color.Magenta
Me.btnSave.Name = "btnSave"
Me.btnSave.Size = New System.Drawing.Size(79, 22)
Me.btnSave.Text = "Speichern"
'
'ToolStripLabel1
'
Me.ToolStripLabel1.Font = New System.Drawing.Font("Segoe UI Semibold", 9.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.ToolStripLabel1.Name = "ToolStripLabel1"
Me.ToolStripLabel1.Size = New System.Drawing.Size(146, 22)
Me.ToolStripLabel1.Text = "Ausgewählte Koordinaten:"
'
'ToolStripLabel2
'
Me.ToolStripLabel2.Name = "ToolStripLabel2"
Me.ToolStripLabel2.Size = New System.Drawing.Size(53, 22)
Me.ToolStripLabel2.Text = "Latitude:"
'
'txtLat
'
Me.txtLat.Name = "txtLat"
Me.txtLat.Size = New System.Drawing.Size(36, 22)
Me.txtLat.Text = "txtLat"
'
'ToolStripLabel4
'
Me.ToolStripLabel4.Name = "ToolStripLabel4"
Me.ToolStripLabel4.Size = New System.Drawing.Size(64, 22)
Me.ToolStripLabel4.Text = "Longitude:"
'
'txtLon
'
Me.txtLon.Name = "txtLon"
Me.txtLon.Size = New System.Drawing.Size(40, 22)
Me.txtLon.Text = "txtLon"
'
'MapControl1
'
Me.MapControl1.Dock = System.Windows.Forms.DockStyle.Fill
ImageTilesLayer2.Name = "ImageLayer"
VectorItemsLayer2.Name = "VectorLayer"
Me.MapControl1.Layers.Add(ImageTilesLayer2)
Me.MapControl1.Layers.Add(VectorItemsLayer2)
Me.MapControl1.Location = New System.Drawing.Point(0, 25)
Me.MapControl1.Name = "MapControl1"
Me.MapControl1.Size = New System.Drawing.Size(882, 442)
Me.MapControl1.TabIndex = 1
'
'frmGeodataSelect
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.ClientSize = New System.Drawing.Size(882, 467)
Me.Controls.Add(Me.MapControl1)
Me.Controls.Add(Me.ToolStrip1)
Me.Name = "frmGeodataSelect"
Me.Text = "frmGeodataSelect"
Me.ToolStrip1.ResumeLayout(False)
Me.ToolStrip1.PerformLayout()
CType(Me.MapControl1, System.ComponentModel.ISupportInitialize).EndInit()
Me.ResumeLayout(False)
Me.PerformLayout()
End Sub
Friend WithEvents ToolStrip1 As System.Windows.Forms.ToolStrip
Friend WithEvents btnSave As System.Windows.Forms.ToolStripButton
Friend WithEvents ToolStripLabel1 As System.Windows.Forms.ToolStripLabel
Friend WithEvents ToolStripLabel2 As System.Windows.Forms.ToolStripLabel
Friend WithEvents txtLat As System.Windows.Forms.ToolStripLabel
Friend WithEvents ToolStripLabel4 As System.Windows.Forms.ToolStripLabel
Friend WithEvents txtLon As System.Windows.Forms.ToolStripLabel
Friend WithEvents MapControl1 As DevExpress.XtraMap.MapControl
End Class

View File

@ -0,0 +1,123 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="ToolStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
</root>

View File

@ -0,0 +1,76 @@
Imports DevExpress.XtraMap
Public Class frmGeodataSelect
Public SelectedPoint As GeoPoint = Nothing
Private BING_KEY As String = "hQUTlqLLK70bETnonpfi~0jx1pIAq1yQ7gXqbIyzKrg~Au-Tewbty8afAxdbNilSv4JlU7qwU-fQKu0ouH9e1uJmpIyVdA3jugVEWMdy1Rbt"
Private ReadOnly Property ImageLayer() As ImageTilesLayer
Get
Return CType(MapControl1.Layers("ImageLayer"), ImageTilesLayer)
End Get
End Property
Private ReadOnly Property VectorLayer() As VectorItemsLayer
Get
Return CType(MapControl1.Layers("VectorLayer"), VectorItemsLayer)
End Get
End Property
Private ReadOnly Property ItemStorage() As MapItemStorage
Get
Return CType(VectorLayer.Data, MapItemStorage)
End Get
End Property
Public Sub New(currentPoint As GeoPoint)
SelectedPoint = currentPoint
Me.InitializeComponent()
End Sub
Private Sub MapControl1_Click(sender As Object, e As MouseEventArgs) Handles MapControl1.Click
If e.Button <> Windows.Forms.MouseButtons.Left Then
Exit Sub
End If
Dim point As GeoPoint = MapControl1.ScreenPointToCoordPoint(e.Location)
Dim items As New List(Of MapPushpin)
Dim storage As New MapItemStorage()
Dim pin = New MapPushpin()
pin.Location = point
ItemStorage.Items.Clear()
ItemStorage.Items.Add(pin)
txtLat.Text = point.Latitude.ToString()
txtLon.Text = point.Longitude.ToString()
SelectedPoint = point
End Sub
Private Sub frmGeodataSelect_Load(sender As Object, e As EventArgs) Handles Me.Load
Dim dataProvider As New BingMapDataProvider()
dataProvider.BingKey = BING_KEY
ImageLayer.DataProvider = dataProvider
Dim storage As New MapItemStorage()
VectorLayer.Data = storage
If SelectedPoint IsNot Nothing Then
Dim pin = New MapPushpin()
pin.Location = SelectedPoint
ItemStorage.Items.Add(pin)
txtLat.Text = SelectedPoint.Latitude.ToString()
txtLon.Text = SelectedPoint.Longitude.ToString()
End If
End Sub
Private Sub btnSave_Click(sender As Object, e As EventArgs) Handles btnSave.Click
Me.DialogResult = Windows.Forms.DialogResult.OK
Me.Close()
End Sub
End Class