در این ویدئو بخش تاریخچه پروژه ها از ایجاد کلاس تا بکارگیری آن بصورت کامل توضیح داده شده....
Imports System.Xml
Public Class ProjectsRecent
Private Shared Document As New XmlDataDocument
Private Shared Documentpath As String = String.Format("{0}\{1}", Application.LocalUserAppDataPath, "ProjectsRecent.xtd")
Private Shared ItemsValue As New List(Of String)
Public Shared ReadOnly Property Items() As ObjectModel.ReadOnlyCollection(Of String)
Get
Return ItemsValue.AsReadOnly
End Get
End Property
Shared Sub Load()
If IO.File.Exists(Documentpath) Then
Document.Load(Documentpath)
Else
Document.LoadXml("")
End If
ItemsValue.Clear()
With Document.DocumentElement
For Each Item As XmlElement In .ChildNodes
ItemsValue.Add(Item.InnerText)
Next
End With
End Sub
Shared Sub Add(Path As String)
If Path.IsNullOrEmpty Then Exit Sub
Dim Element As XmlElement = Document.CreateElement("Item")
Element.InnerText = Path
With Document
With .DocumentElement
For Each Item As XmlElement In .ChildNodes
If Item.InnerText.ToLower = Path.ToLower Then
Exit Sub
End If
Next
.AppendChild(Element)
End With
.Save(Documentpath)
End With
End Sub
End Class