mirror of https://github.com/icsharpcode/ILSpy.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
108 lines
2.1 KiB
108 lines
2.1 KiB
Imports System |
|
|
|
Public Interface IParameterized |
|
Property IndexedValue(index As Integer) As Integer |
|
End Interface |
|
|
|
Public Class ParameterizedProperties |
|
Implements IParameterized |
|
|
|
Private _field As Integer |
|
|
|
Public Shared Property SharedProp(index As Integer) As Integer |
|
Get |
|
Return index |
|
End Get |
|
Set(value As Integer) |
|
End Set |
|
End Property |
|
|
|
Public Property IndexedValue(index As Integer) As Integer Implements IParameterized.IndexedValue |
|
Get |
|
Return _field |
|
End Get |
|
Set(value As Integer) |
|
_field = value |
|
End Set |
|
End Property |
|
|
|
Public ReadOnly Property ReadOnlyProp(index As Integer) As Integer |
|
Get |
|
Return index |
|
End Get |
|
End Property |
|
|
|
Public WriteOnly Property SetOnly(index As Integer) As Integer |
|
Set(value As Integer) |
|
_field = index + value |
|
End Set |
|
End Property |
|
|
|
<Obsolete("read-write parameterized property")> |
|
Public Property Attributed(index As Integer) As Integer |
|
Get |
|
Return index |
|
End Get |
|
Set(value As Integer) |
|
End Set |
|
End Property |
|
|
|
Public ReadOnly Property Overloaded(a As Integer) As Integer |
|
Get |
|
Return a |
|
End Get |
|
End Property |
|
|
|
Public ReadOnly Property Overloaded(a As Integer, b As Integer) As Integer |
|
Get |
|
Return a + b |
|
End Get |
|
End Property |
|
|
|
Public Sub Use() |
|
SharedProp(1) = 2 |
|
_field = SharedProp(3) |
|
IndexedValue(4) = 5 |
|
_field = IndexedValue(6) |
|
Dim p As IParameterized = Me |
|
p.IndexedValue(7) = 8 |
|
_field = p.IndexedValue(9) |
|
End Sub |
|
End Class |
|
|
|
Public Class ParameterizedBase |
|
Public Overridable Property Virt(index As Integer) As Integer |
|
Get |
|
Return index |
|
End Get |
|
Set(value As Integer) |
|
End Set |
|
End Property |
|
End Class |
|
|
|
Public Class ParameterizedDerived |
|
Inherits ParameterizedBase |
|
|
|
Public Overrides Property Virt(index As Integer) As Integer |
|
Get |
|
Return index + 1 |
|
End Get |
|
Set(value As Integer) |
|
End Set |
|
End Property |
|
End Class |
|
|
|
Public Class RenamedImplementation |
|
Implements IParameterized |
|
|
|
Private _value As Integer |
|
|
|
Public Property Renamed(index As Integer) As Integer Implements IParameterized.IndexedValue |
|
Get |
|
Return _value |
|
End Get |
|
Set(value As Integer) |
|
_value = value |
|
End Set |
|
End Property |
|
End Class
|
|
|