mirror of https://github.com/icsharpcode/ILSpy.git
7 changed files with 99 additions and 11 deletions
@ -0,0 +1,39 @@ |
|||||||
|
using System; |
||||||
|
|
||||||
|
public class VBPropertiesTest |
||||||
|
{ |
||||||
|
private int _fullProperty; |
||||||
|
|
||||||
|
public int FullProperty { |
||||||
|
get { |
||||||
|
return _fullProperty; |
||||||
|
} |
||||||
|
set { |
||||||
|
_fullProperty = value; |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
public int AutoProperty { get; set; } |
||||||
|
|
||||||
|
#if ROSLYN
|
||||||
|
public int ReadOnlyAutoProperty { get; } |
||||||
|
public VBPropertiesTest() |
||||||
|
{ |
||||||
|
ReadOnlyAutoProperty = 32; |
||||||
|
} |
||||||
|
#endif
|
||||||
|
|
||||||
|
public void TestMethod() |
||||||
|
{ |
||||||
|
FullProperty = 42; |
||||||
|
_fullProperty = 24; |
||||||
|
AutoProperty = 4711; |
||||||
|
|
||||||
|
Console.WriteLine(AutoProperty); |
||||||
|
Console.WriteLine(_fullProperty); |
||||||
|
Console.WriteLine(FullProperty); |
||||||
|
#if ROSLYN
|
||||||
|
Console.WriteLine(ReadOnlyAutoProperty); |
||||||
|
#endif
|
||||||
|
} |
||||||
|
} |
@ -0,0 +1,37 @@ |
|||||||
|
Imports System |
||||||
|
Public Class VBPropertiesTest |
||||||
|
Private _fullProperty As Integer |
||||||
|
|
||||||
|
Property FullProperty As Integer |
||||||
|
Get |
||||||
|
Return _fullProperty |
||||||
|
End Get |
||||||
|
Set(value As Integer) |
||||||
|
_fullProperty = value |
||||||
|
End Set |
||||||
|
End Property |
||||||
|
|
||||||
|
Property AutoProperty As Integer |
||||||
|
|
||||||
|
#If ROSLYN Then |
||||||
|
ReadOnly Property ReadOnlyAutoProperty As Integer |
||||||
|
|
||||||
|
Sub New() |
||||||
|
Me.ReadOnlyAutoProperty = 32 |
||||||
|
End Sub |
||||||
|
#End If |
||||||
|
|
||||||
|
Sub TestMethod() |
||||||
|
Me.FullProperty = 42 |
||||||
|
Me._fullProperty = 24 |
||||||
|
Me.AutoProperty = 4711 |
||||||
|
|
||||||
|
Console.WriteLine(Me.AutoProperty) |
||||||
|
Console.WriteLine(Me._fullProperty) |
||||||
|
Console.WriteLine(Me.FullProperty) |
||||||
|
|
||||||
|
#If ROSLYN Then |
||||||
|
Console.WriteLine(Me.ReadOnlyAutoProperty) |
||||||
|
#End If |
||||||
|
End Sub |
||||||
|
End Class |
Loading…
Reference in new issue