-
Notifications
You must be signed in to change notification settings - Fork 23
/
Copy pathGlobalCompositionsScenario.cs
40 lines (33 loc) · 1.1 KB
/
GlobalCompositionsScenario.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
/*
$v=true
$p=9
$d=Global compositions
$h=When the `Setup(name, kind)` method is called, the second optional parameter specifies the composition kind. If you set it as `CompositionKind.Global`, no composition class will be created, but this setup will be the base setup for all others in the current project, and `DependsOn(...)` is not required. The setups will be applied in the sort order of their names.
*/
// ReSharper disable CheckNamespace
// ReSharper disable UnusedMember.Local
// ReSharper disable UnusedType.Global
// ReSharper disable ArrangeTypeModifiers
// ReSharper disable ArrangeTypeMemberModifiers
namespace Pure.DI.UsageTests.Advanced.GlobalCompositionsScenario;
using static CompositionKind;
// {
//# using Pure.DI;
//# using static Pure.DI.CompositionKind;
//# return;
// }
// {
class MyGlobalComposition
{
static void Setup() =>
DI.Setup(kind: Global)
.Hint(Hint.ToString, "Off")
.Hint(Hint.FormatCode, "On");
}
class MyGlobalComposition2
{
static void Setup() =>
DI.Setup("Some name", kind: Global)
.Hint(Hint.ToString, "On");
}
// }