Advertisement
Guest User

Untitled

a guest
Jul 29th, 2016
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. Enum Test
  2. One
  3. Two
  4. Three
  5. End Enum
  6.  
  7. Private Class MyTest
  8.  
  9. Default Public Shadows ReadOnly Property Item(Index As Integer) As Object
  10. Get
  11. Console.WriteLine("From Integer " & Index.ToString())
  12. Return Nothing
  13. End Get
  14. End Property
  15.  
  16. Default Public Shadows Property Item(Field As Test) As Object
  17. Get
  18. Console.WriteLine("From Enum " & Field.ToString())
  19. Return Nothing
  20. End Get
  21. Set(value As Object)
  22. Console.WriteLine("Set From Enum " & Field.ToString())
  23. End Set
  24. End Property
  25. End Class
  26.  
  27. Sub Main()
  28. Dim T As New MyTest()
  29. Dim A = T.Item(Test.One)
  30. Dim B = T.Item(2)
  31. Dim C = T.Item(23)
  32. Console.ReadLine()
  33. End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement