Class TypeIdentifierPattern
Defines the pattern matching on top-level type identifiers.
[GenerateKeyedMatchNode]
public record TypeIdentifierPattern : Pattern<ITypeDefOrRef?>, IEquatable<Pattern>, IEquatable<Pattern<ITypeDefOrRef?>>, IEquatable<TypeIdentifierPattern>
- Inheritance
-
TypeIdentifierPattern
- Implements
- Inherited Members
- Extension Methods
Constructors
TypeIdentifierPattern(Pattern<IResolutionScope?>, Pattern<string?>, Pattern<string?>)
Defines the pattern matching on top-level type identifiers.
public TypeIdentifierPattern(Pattern<IResolutionScope?> Scope, Pattern<string?> Namespace, Pattern<string?> Name)
Parameters
ScopePattern<IResolutionScope>The pattern describing the scope defining the type.
NamespacePattern<string>The pattern describing the namespace of the type.
NamePattern<string>The pattern describing the name of the type.
TypeIdentifierPattern(Pattern<IResolutionScope>, string?, string?)
Constructs a new concrete type identifier pattern.
public TypeIdentifierPattern(Pattern<IResolutionScope> scope, string? ns, string? name)
Parameters
scopePattern<IResolutionScope>The expected resolution scope.
nsstringThe expected namespace.
namestringThe expected name.
TypeIdentifierPattern(TypeIdentifierPattern)
protected TypeIdentifierPattern(TypeIdentifierPattern original)
Parameters
originalTypeIdentifierPattern
TypeIdentifierPattern(string?, string?)
Constructs a new concrete type identifier pattern.
public TypeIdentifierPattern(string? ns, string? name)
Parameters
Fields
Boolean
public static readonly TypeIdentifierPattern Boolean
Field Value
Byte
public static readonly TypeIdentifierPattern Byte
Field Value
Char
public static readonly TypeIdentifierPattern Char
Field Value
Double
public static readonly TypeIdentifierPattern Double
Field Value
Int16
public static readonly TypeIdentifierPattern Int16
Field Value
Int32
public static readonly TypeIdentifierPattern Int32
Field Value
Int64
public static readonly TypeIdentifierPattern Int64
Field Value
IntPtr
public static readonly TypeIdentifierPattern IntPtr
Field Value
Object
public static readonly TypeIdentifierPattern Object
Field Value
SByte
public static readonly TypeIdentifierPattern SByte
Field Value
Single
public static readonly TypeIdentifierPattern Single
Field Value
String
public static readonly TypeIdentifierPattern String
Field Value
TypedReference
public static readonly TypeIdentifierPattern TypedReference
Field Value
UInt16
public static readonly TypeIdentifierPattern UInt16
Field Value
UInt32
public static readonly TypeIdentifierPattern UInt32
Field Value
UInt64
public static readonly TypeIdentifierPattern UInt64
Field Value
UIntPtr
public static readonly TypeIdentifierPattern UIntPtr
Field Value
Void
public static readonly TypeIdentifierPattern Void
Field Value
Properties
EqualityContract
protected override Type EqualityContract { get; }
Property Value
Name
The pattern describing the name of the type.
public Pattern<string?> Name { get; init; }
Property Value
Namespace
The pattern describing the namespace of the type.
public Pattern<string?> Namespace { get; init; }
Property Value
Scope
The pattern describing the scope defining the type.
public Pattern<IResolutionScope?> Scope { get; init; }
Property Value
Methods
Deconstruct(out Pattern<IResolutionScope?>, out Pattern<string?>, out Pattern<string?>)
public void Deconstruct(out Pattern<IResolutionScope?> Scope, out Pattern<string?> Namespace, out Pattern<string?> Name)
Parameters
Equals(Pattern<ITypeDefOrRef?>?)
public override sealed bool Equals(Pattern<ITypeDefOrRef?>? other)
Parameters
otherPattern<ITypeDefOrRef>
Returns
Equals(TypeIdentifierPattern?)
public virtual bool Equals(TypeIdentifierPattern? other)
Parameters
otherTypeIdentifierPattern
Returns
Equals(object?)
public override bool Equals(object? obj)
Parameters
objobject
Returns
Format(IndentedTextWriter)
Serializes the pattern to a readable string.
public override void Format(IndentedTextWriter writer)
Parameters
writerIndentedTextWriterThe output stream.
GetHashCode()
public override int GetHashCode()
Returns
Match(ITypeDefOrRef?, MatchingContext)
Attempts to match the provided input to the pattern.
public override IMatchNode<ITypeDefOrRef?>? Match(ITypeDefOrRef? input, MatchingContext context)
Parameters
inputITypeDefOrRefThe input to match.
contextMatchingContextThe context in which to match the pattern to.
Returns
- IMatchNode<ITypeDefOrRef>
When successful, returns the root node of the match tree, otherwise
null.
PrintMembers(StringBuilder)
protected override bool PrintMembers(StringBuilder builder)
Parameters
builderStringBuilder
Returns
Operators
operator ==(TypeIdentifierPattern?, TypeIdentifierPattern?)
public static bool operator ==(TypeIdentifierPattern? left, TypeIdentifierPattern? right)
Parameters
leftTypeIdentifierPatternrightTypeIdentifierPattern
Returns
operator !=(TypeIdentifierPattern?, TypeIdentifierPattern?)
public static bool operator !=(TypeIdentifierPattern? left, TypeIdentifierPattern? right)
Parameters
leftTypeIdentifierPatternrightTypeIdentifierPattern