-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathAllOfSignature.cs
More file actions
56 lines (48 loc) · 1.33 KB
/
AllOfSignature.cs
File metadata and controls
56 lines (48 loc) · 1.33 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
using System;
using System.Collections.Immutable;
using System.Reflection;
namespace ClassExplorer.Signatures
{
internal sealed class AllOfTypeSignature : UniversialSignature
{
internal AllOfTypeSignature(ImmutableArray<ISignature> elements)
{
Poly.Assert(!elements.IsDefaultOrEmpty);
Elements = elements;
}
public ImmutableArray<ISignature> Elements { get; }
public override bool IsMatch(ParameterInfo parameter)
{
foreach (ITypeSignature signature in Elements)
{
if (!signature.IsMatch(parameter))
{
return false;
}
}
return true;
}
public override bool IsMatch(Type type)
{
foreach (ITypeSignature signature in Elements)
{
if (!signature.IsMatch(type))
{
return false;
}
}
return true;
}
public override bool IsMatch(MemberInfo subject)
{
foreach (IMemberSignature signature in Elements)
{
if (!signature.IsMatch(subject))
{
return false;
}
}
return true;
}
}
}