Advertisement
richcoleman

Object Properties

Nov 11th, 2011
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 1.33 KB | None | 0 0
  1.  
  2. Public Class Test
  3.  
  4.     Public Sub New()
  5.  
  6.         Dim doc As New Process.Document()
  7.         doc.Source.Type = "URL"
  8.         doc.Source.Data = "http://myOtherDomain/MyOtherPage.htm"
  9.  
  10.         Dim p As New Process()
  11.         p.Documents.Add(doc)
  12.  
  13.     End Sub
  14.  
  15. End Class
  16.  
  17.  
  18. Public Class Process
  19.  
  20.     Public Documents As New DocumentCollection()
  21.  
  22.     Public Class Document
  23.  
  24.         Public Source As New DocumentSource()
  25.  
  26.         Public Class DocumentSource
  27.  
  28.             Private _type As String = "URL"
  29.             Public Property Type() As String
  30.                 Get
  31.                     Return _type
  32.                 End Get
  33.                 Set(ByVal value As String)
  34.                     _type = value
  35.                 End Set
  36.             End Property
  37.  
  38.             Private _data As String = "http://www.mydomain/Mypage.html"
  39.             Public Property Data() As String
  40.                 Get
  41.                     Return _data
  42.                 End Get
  43.                 Set(ByVal value As String)
  44.                     _data = value
  45.                 End Set
  46.             End Property
  47.  
  48.         End Class
  49.  
  50.     End Class
  51.  
  52.     NotInheritable Class DocumentCollection
  53.         Inherits CollectionBase
  54.  
  55.         Public Sub Add(ByVal document As Document)
  56.             List.Add(document)
  57.         End Sub
  58.  
  59.     End Class
  60.  
  61. End Class
  62.  
  63.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement