forked from ahotko/c-sharp-code-examples
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ConditionalSample.cs
52 lines (45 loc) · 1.25 KB
/
ConditionalSample.cs
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
#define CONDITION1
#define CONDITION2
using System;
using System.Diagnostics;
namespace CodeSamples.Attributes
{
public class ConditionalSample : SampleExecute
{
[Conditional("CONDITION1")]
private void MethodCondition1()
{
Console.WriteLine("MethodCondition1");
}
[Conditional("CONDITION2")]
private void MethodCondition2()
{
Console.WriteLine("MethodCondition2");
}
[Conditional("CONDITION3")]
private void MethodCondition3()
{
Console.WriteLine("MethodCondition3");
}
[Conditional("CONDITION1"), Conditional("CONDITION2")]
private void MethodCondition1or2()
{
Console.WriteLine("MethodCondition1or2");
}
[Conditional("CONDITION1"), Conditional("CONDITION3")]
private void MethodCondition1or3()
{
Console.WriteLine("MethodCondition1or3");
}
public override void Execute()
{
Title("ConditionalSampleExecute");
MethodCondition1();
MethodCondition2();
MethodCondition3();
MethodCondition1or2();
MethodCondition1or3();
Finish();
}
}
}