|
|
|
@ -22,9 +22,10 @@ namespace ICSharpCode.Decompiler.Tests.TestCases.Pretty |
|
|
|
{ |
|
|
|
{ |
|
|
|
internal class SemiAutoProperties |
|
|
|
internal class SemiAutoProperties |
|
|
|
{ |
|
|
|
{ |
|
|
|
// Semi-auto property with validation in setter
|
|
|
|
|
|
|
|
public int ValidatedProperty { |
|
|
|
public int ValidatedProperty { |
|
|
|
get => field; |
|
|
|
get { |
|
|
|
|
|
|
|
return field; |
|
|
|
|
|
|
|
} |
|
|
|
set { |
|
|
|
set { |
|
|
|
if (value < 0) |
|
|
|
if (value < 0) |
|
|
|
{ |
|
|
|
{ |
|
|
|
@ -34,7 +35,6 @@ namespace ICSharpCode.Decompiler.Tests.TestCases.Pretty |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Semi-auto property with lazy initialization
|
|
|
|
|
|
|
|
public string LazyProperty { |
|
|
|
public string LazyProperty { |
|
|
|
get { |
|
|
|
get { |
|
|
|
if (field == null) |
|
|
|
if (field == null) |
|
|
|
@ -43,12 +43,15 @@ namespace ICSharpCode.Decompiler.Tests.TestCases.Pretty |
|
|
|
} |
|
|
|
} |
|
|
|
return field; |
|
|
|
return field; |
|
|
|
} |
|
|
|
} |
|
|
|
set => field = value; |
|
|
|
set { |
|
|
|
|
|
|
|
field = value; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Semi-auto property with notification
|
|
|
|
|
|
|
|
public int NotifyProperty { |
|
|
|
public int NotifyProperty { |
|
|
|
get => field; |
|
|
|
get { |
|
|
|
|
|
|
|
return field; |
|
|
|
|
|
|
|
} |
|
|
|
set { |
|
|
|
set { |
|
|
|
if (field != value) |
|
|
|
if (field != value) |
|
|
|
{ |
|
|
|
{ |
|
|
|
@ -58,7 +61,6 @@ namespace ICSharpCode.Decompiler.Tests.TestCases.Pretty |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Getter-only semi-auto property with initialization
|
|
|
|
|
|
|
|
public int ReadOnlyWithInit { |
|
|
|
public int ReadOnlyWithInit { |
|
|
|
get { |
|
|
|
get { |
|
|
|
if (field == 0) |
|
|
|
if (field == 0) |
|
|
|
|