-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathNullableAnnotationTests.cs
More file actions
55 lines (50 loc) · 1.7 KB
/
NullableAnnotationTests.cs
File metadata and controls
55 lines (50 loc) · 1.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
using System.Threading.Tasks;
namespace DevExpress.Mvvm.CodeGenerators.Tests {
#if !WINUI
[GenerateViewModel(ImplementINotifyPropertyChanging = true, ImplementIDataErrorInfo = true, ImplementISupportServices = true)]
#else
[GenerateViewModel(ImplementINotifyPropertyChanging = true, ImplementISupportUIServices = true)]
#endif
public partial class NullableAnnotation {
#nullable enable
public NullableAnnotation() {
string1 = "123";
}
[GenerateProperty]
int int1;
[GenerateProperty]
int? nullableInt1;
[GenerateProperty]
string string1;
[GenerateProperty]
string? nullableString1;
[GenerateCommand]
void NullableParameter1(string? str) { }
[GenerateCommand]
void NonNullableParameter1(string str) { }
[GenerateCommand]
Task NullableParameterAsync1(string? str) => Task.CompletedTask;
[GenerateCommand]
Task NonNullableParameterAsync1(string str) => Task.CompletedTask;
#nullable disable
[GenerateProperty]
int int2;
[GenerateProperty]
int? nullableInt2;
[GenerateProperty]
string string2;
#pragma warning disable 8632
[GenerateProperty]
string? nullableString2;
[GenerateCommand]
void NullableParameter2(string? str) { }
[GenerateCommand]
void NonNullableParameter2(string str) { }
[GenerateCommand]
Task NullableParameterAsync2(string? str) => Task.CompletedTask;
[GenerateCommand]
Task NonNullableParameterAsync2(string str) => Task.CompletedTask;
void OnString1Changed(string str) { }
#pragma warning restore 8632
}
}