-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathIMethodBodyBuilder.cs
More file actions
49 lines (40 loc) · 1.6 KB
/
IMethodBodyBuilder.cs
File metadata and controls
49 lines (40 loc) · 1.6 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
namespace EasySourceGenerators.Abstractions;
// ReSharper disable TypeParameterCanBeVariant - not available for every overload, so not used for consistency
public interface IMethodBodyBuilderStage1 : IMethodBodyBuilder
{
IMethodBodyBuilderStage2 ForMethod();
}
public interface IMethodBodyBuilderStage2
{
IMethodBodyBuilderStage3ReturnVoid WithVoidReturnType();
IMethodBodyBuilderStage3<TReturnType> WithReturnType<TReturnType>();
}
public interface IMethodBodyBuilderStage3ReturnVoid
{
IMethodBodyBuilderStage4ReturnVoidNoArg WithNoParameters();
IMethodBodyBuilderStage4ReturnVoid<TParam1> WithOneParameter<TParam1>();
}
public interface IMethodBodyBuilderStage3<TReturnType>
{
IMethodBodyBuilderStage4NoArg<TReturnType> WithNoParameters();
IMethodBodyBuilderStage4<TParam1, TReturnType> WithOneParameter<TParam1>();
}
public interface IMethodBodyBuilderStage4ReturnVoidNoArg
{
IMethodBodyGenerator UseProvidedBody(Action body);
}
public interface IMethodBodyBuilderStage4NoArg<TReturnType>
{
IMethodBodyGenerator UseProvidedBody(Func<TReturnType> body);
IMethodBodyGenerator BodyRetuningConstant(Func<TReturnType> constantValueFactory);
}
public interface IMethodBodyBuilderStage4ReturnVoid<TParam1>
{
IMethodBodyGenerator UseProvidedBody(Action<TParam1> body);
}
public interface IMethodBodyBuilderStage4<TParam1, TReturnType>
{
IMethodBodyGenerator UseProvidedBody(Func<TParam1, TReturnType> body);
IMethodBodyGenerator BodyRetuningConstant(Func<TReturnType> constantValueFactory);
IMethodBodyGeneratorSwitchBody<TParam1, TReturnType> BodyWithSwitchStatement();
}