Mini Kabibi Habibi
Imports Microsoft.VisualBasic
Imports System.Xml.Serialization
Imports System.Collections.Generic
Imports System.IO
Imports System.Web
Namespace DevExpress.Web.Demos
<XmlRoot("Themes")> _
Public Class ThemesModel
Private Shared _current As ThemesModel
Private Shared ReadOnly _currentLock As Object = New Object()
Public Shared ReadOnly Property Current() As ThemesModel
Get
SyncLock _currentLock
If _current Is Nothing Then
Using stream As Stream = File.OpenRead(HttpContext.Current.Server.MapPath("~/App_Data/Themes.xml"))
Dim serializer As New XmlSerializer(GetType(ThemesModel))
_current = CType(serializer.Deserialize(stream), ThemesModel)
End Using
End If
Return _current
End SyncLock
End Get
End Property
Private _groups As New List(Of ThemeGroupModel)()
<XmlElement("ThemeGroup")> _
Public ReadOnly Property Groups() As List(Of ThemeGroupModel)
Get
Return _groups
End Get
End Property
End Class
End Namespace