jj
This commit is contained in:
@@ -106,4 +106,44 @@ Public Class frmMain
|
||||
frm.MdiParent = DocumentManager.MdiParent
|
||||
frm.Show()
|
||||
End Sub
|
||||
|
||||
Private Sub BarButtonItem2_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles BarButtonItem2.ItemClick
|
||||
Dim oUser1 = New LicenseModuleUser With {
|
||||
.Type = UserType.PowerUser,
|
||||
.Test = False,
|
||||
.Count = 5,
|
||||
.ValidUntil = New Date(),
|
||||
.ValidUntilSpecified = True
|
||||
}
|
||||
|
||||
Dim oUsers As New List(Of LicenseModuleUser)
|
||||
oUsers.Add(oUser1)
|
||||
|
||||
Dim oModule = New LicenseModule() With {
|
||||
.Users = oUsers.ToArray(),
|
||||
.Name = "EDMI",
|
||||
.ValidUntil = New Date(),
|
||||
.ValidUntilSpecified = True
|
||||
}
|
||||
|
||||
Dim oModules As New List(Of LicenseModule)
|
||||
oModules.Add(oModule)
|
||||
|
||||
Dim oLicense = New License() With {
|
||||
.Modules = oModules.ToArray
|
||||
}
|
||||
|
||||
Dim oSerializer As New Xml.Serialization.XmlSerializer(GetType(License))
|
||||
|
||||
Using oStream = New FileStream("E:\license.xml", FileMode.Create)
|
||||
oSerializer.Serialize(oStream, oLicense)
|
||||
oStream.Flush()
|
||||
End Using
|
||||
|
||||
Dim oLicense2 As License
|
||||
|
||||
Using oReader As New StreamReader("E:\license.xml")
|
||||
oLicense2 = oSerializer.Deserialize(oReader)
|
||||
End Using
|
||||
End Sub
|
||||
End Class
|
||||
Reference in New Issue
Block a user