Merge branch 'master' of http://SchreiberM@172.24.11.74:90/scm/git/RecordOrganizer
This commit is contained in:
@@ -184,4 +184,40 @@ Public Class ClassLayout
|
||||
|
||||
Return Result
|
||||
End Function
|
||||
|
||||
Public Sub PutValue(Name As String, Value As String)
|
||||
Dim doc As XDocument = XDocument.Load(_filename)
|
||||
Dim settings As XElement = doc.Element("Settings")
|
||||
|
||||
Dim el As XElement = settings.Descendants("Setting").Where(Function(s)
|
||||
Return s.Attribute("name") = Name
|
||||
End Function).SingleOrDefault()
|
||||
|
||||
If IsNothing(el) Then
|
||||
settings.Add(New XElement("Setting",
|
||||
New XAttribute("name", Name),
|
||||
New XAttribute("value", Value)))
|
||||
Else
|
||||
el.SetAttributeValue("value", Value)
|
||||
End If
|
||||
|
||||
doc.Save(_filename)
|
||||
End Sub
|
||||
|
||||
Public Function GetValue(Name As String) As String
|
||||
Dim doc As XDocument = XDocument.Load(_filename)
|
||||
Dim settings As XElement = doc.Element("Settings")
|
||||
|
||||
Dim el As XElement = settings.Descendants("Setting").Where(Function(s)
|
||||
Return s.Attribute("name") = Name
|
||||
End Function).SingleOrDefault()
|
||||
|
||||
If IsNothing(el) Then
|
||||
Return Nothing
|
||||
Else
|
||||
Return el.Attribute("value").Value
|
||||
End If
|
||||
End Function
|
||||
|
||||
|
||||
End Class
|
||||
|
||||
@@ -6067,7 +6067,7 @@ Public Class frmConstructor_Main
|
||||
JUMP_RECORD_ID = 0
|
||||
End Sub
|
||||
Private Sub ToolStripButton2_Click(sender As Object, e As EventArgs) Handles tsbtnGeodata.Click
|
||||
ClassHelper.MSGBOX_Handler("ERROR", "Unexpected Error", "Error in Show_Detail_Record: ", "dsdfsdfdsfdsf")
|
||||
'ClassHelper.MSGBOX_Handler("ERROR", "Unexpected Error", "Error in Show_Detail_Record: ", "dsdfsdfdsfdsf")
|
||||
Dim frm As New frmGeodataNavigation(GridControlMain, CURRENT_ENTITY_ID)
|
||||
frm.Show()
|
||||
End Sub
|
||||
|
||||
@@ -34,6 +34,9 @@ Public Class frmGeodataSelect
|
||||
dataProvider.BingKey = BING_KEY
|
||||
ImageLayer.DataProvider = dataProvider
|
||||
|
||||
Dim XMLPath = Get_Settings_Filename()
|
||||
Dim layout As New ClassLayout(XMLPath)
|
||||
|
||||
Dim storage As New MapItemStorage()
|
||||
VectorLayer.Data = storage
|
||||
|
||||
@@ -45,7 +48,14 @@ Public Class frmGeodataSelect
|
||||
txtLat.Text = SelectedPoint.Latitude.ToString()
|
||||
txtLon.Text = SelectedPoint.Longitude.ToString()
|
||||
|
||||
MapControl1.ZoomLevel = 7
|
||||
Dim zoomLevel = layout.GetValue("MapControlSelect_ZoomLevel")
|
||||
|
||||
If IsNothing(zoomLevel) Then
|
||||
MapControl1.ZoomLevel = 10.0
|
||||
Else
|
||||
MapControl1.ZoomLevel = Double.Parse(zoomLevel)
|
||||
End If
|
||||
|
||||
MapControl1.ZoomToFit(New List(Of MapPushpin) From {pin})
|
||||
End If
|
||||
|
||||
@@ -77,10 +87,22 @@ Public Class frmGeodataSelect
|
||||
End Sub
|
||||
|
||||
Private Sub btnSave_Click(sender As Object, e As EventArgs) Handles btnSave.Click
|
||||
Dim XMLPath = Get_Settings_Filename()
|
||||
Dim layout As New ClassLayout(XMLPath)
|
||||
Dim settings As New System.Collections.Generic.List(Of ClassSetting)
|
||||
settings = layout.Load()
|
||||
|
||||
layout.PutValue("MapControlSelect_ZoomLevel", MapControl1.ZoomLevel)
|
||||
|
||||
Me.DialogResult = Windows.Forms.DialogResult.OK
|
||||
Me.Close()
|
||||
End Sub
|
||||
|
||||
Private Function Get_Settings_Filename()
|
||||
Dim Filename As String = String.Format("{0}-Geodata-Layout.xml", CURRENT_CONSTRUCTOR_ID)
|
||||
Return System.IO.Path.Combine(Application.UserAppDataPath(), Filename)
|
||||
End Function
|
||||
|
||||
Private Sub tsbtnactivate_Click(sender As Object, e As EventArgs) Handles tsbtnactivate.Click
|
||||
If _SelectActive = False Then
|
||||
_SelectActive = True
|
||||
|
||||
Reference in New Issue
Block a user