|
Imports System.Configuration
Imports System.Xml
Public Class LocalizationConfiguration
#Region "fields and properties"
Private _defaultCultureName As String
Private _languageFilePath As String
Public Property DefaultCultureName() As String
Get
Return _defaultCultureName
End Get
Set(ByVal Value As String)
_defaultCultureName = Value
End Set
End Property
Public Property LanguageFilePath() As String
Get
Return _languageFilePath
End Get
Set(ByVal Value As String)
_languageFilePath = Value
End Set
End Property
#End Region
Public Shared Function GetConfig() As LocalizationConfiguration
Return CType(ConfigurationSettings.GetConfig("Localization/Localization"), LocalizationConfiguration)
End Function
Friend Sub LoadConfigValues(ByVal node As XmlNode)
Dim attributeCollection As XmlAttributeCollection = node.Attributes
_defaultCultureName = attributeCollection("defaultCulture").Value
_languageFilePath = attributeCollection("languageFilePath").Value
End Sub
End Class
Friend Class LocalizationConfigurationHandler
Implements IConfigurationSectionHandler
Public Function Create(ByVal parent As Object, ByVal configContext As Object, ByVal node As XmlNode) As Object Implements System.Configuration.IConfigurationSectionHandler.Create
Dim config As New LocalizationConfiguration
config.LoadConfigValues(node)
Return config
End Function
End Class
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.