Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Region "Form Events"
- Private Sub SettingsForm_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
- InitData()
- InitUI()
- End Sub
- #End Region
- #Region "Data"
- Private Sub InitData()
- ImportsLanguageNames()
- End Sub
- Private Sub ImportsLanguageNames()
- 'Load an xml file
- 'Generate a path for the languages.xml file
- Dim path As String = Application.StartupPath & "\data\languages.xml"
- 'Deal with xml
- Try
- Dim xmlDoc As New XmlDocument
- xmlDoc.Load(path)
- Dim xmlRoot As XmlElement = xmlDoc.DocumentElement
- 'SetThe Progress Value
- Me.MainDataSet.Language.Clear()
- ' For i As Integer = 0 To xmlRoot.ChildNodes.Count - 1
- For Each e As XmlElement In xmlRoot.ChildNodes
- Dim languageName As String = e.InnerText
- Dim languageValue As String = e.GetAttribute("value")
- MainDataSet.Language.AddLanguageRow(languageName, languageValue)
- Next
- Catch
- MessageBox.Show("Can't find the file 'languages.xml'", "AfterCopy3.0", MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1)
- Me.Dispose(True)
- End Try
- End Sub
- #End Region
Add Comment
Please, Sign In to add comment