-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathObjectExtensions.FluentDelegates.cs
More file actions
88 lines (76 loc) · 2.23 KB
/
Copy pathObjectExtensions.FluentDelegates.cs
File metadata and controls
88 lines (76 loc) · 2.23 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
namespace System.Fluent
{
public static class ObjectExtensions
{
public static T Action<T>(this T self, Action action)
{
action();
return self;
}
public static T Action<T>(this T self, Action<T> action)
{
action(self);
return self;
}
public static T Action<T>(this T self, ReadStructAction<T> action)
where T : struct
{
action(self);
return self;
}
public static T Func<T, TResult>(this T self, Func<TResult> func)
{
func();
return self;
}
public static T Func<T, TResult>(this T self, Func<T, TResult> func)
{
func(self);
return self;
}
public static T Func<T, TResult>(this T self, ReadStructFunc<T, TResult> func)
where T : struct
{
func(self);
return self;
}
public static T Func<T, TResult>(this T self, out TResult result, Func<TResult> func)
{
result = func();
return self;
}
public static T Func<T, TResult>(this T self, out TResult result, Func<T, TResult> func)
{
result = func(self);
return self;
}
public static T Func<T, TResult>(this T self, out TResult result, ReadStructFunc<T, TResult> func)
where T : struct
{
result = func(self);
return self;
}
public static T Predicate<T>(this T self, Predicate<T> predicate)
{
predicate(self);
return self;
}
public static T Predicate<T>(this T self, ReadStructPredicate<T> predicate)
where T : struct
{
predicate(self);
return self;
}
public static T Predicate<T>(this T self, out bool result, Predicate<T> predicate)
{
result = predicate(self);
return self;
}
public static T Predicate<T>(this T self, out bool result, ReadStructPredicate<T> predicate)
where T : struct
{
result = predicate(self);
return self;
}
}
}