Table of Contents

Class TypeSpecificationPattern

Namespace
CilFi.Patterns
Assembly
CilFi.Core.dll

Defines the pattern matching type specifications.

[GenerateKeyedMatchNode]
public record TypeSpecificationPattern : Pattern<ITypeDefOrRef?>, IEquatable<Pattern>, IEquatable<Pattern<ITypeDefOrRef?>>, IEquatable<TypeSpecificationPattern>
Inheritance
TypeSpecificationPattern
Implements
Inherited Members
Extension Methods

Constructors

TypeSpecificationPattern(Pattern<TypeSignature>)

Defines the pattern matching type specifications.

public TypeSpecificationPattern(Pattern<TypeSignature> Signature)

Parameters

Signature Pattern<TypeSignature>

The pattern described the wrapped type signature.

TypeSpecificationPattern(TypeSpecificationPattern)

protected TypeSpecificationPattern(TypeSpecificationPattern original)

Parameters

original TypeSpecificationPattern

Properties

EqualityContract

protected override Type EqualityContract { get; }

Property Value

Type

Signature

The pattern described the wrapped type signature.

public Pattern<TypeSignature> Signature { get; init; }

Property Value

Pattern<TypeSignature>

Methods

Deconstruct(out Pattern<TypeSignature>)

public void Deconstruct(out Pattern<TypeSignature> Signature)

Parameters

Signature Pattern<TypeSignature>

Equals(Pattern<ITypeDefOrRef?>?)

public override sealed bool Equals(Pattern<ITypeDefOrRef?>? other)

Parameters

other Pattern<ITypeDefOrRef>

Returns

bool

Equals(TypeSpecificationPattern?)

public virtual bool Equals(TypeSpecificationPattern? other)

Parameters

other TypeSpecificationPattern

Returns

bool

Equals(object?)

public override bool Equals(object? obj)

Parameters

obj object

Returns

bool

Format(IndentedTextWriter)

Serializes the pattern to a readable string.

public override void Format(IndentedTextWriter writer)

Parameters

writer IndentedTextWriter

The output stream.

GetHashCode()

public override int GetHashCode()

Returns

int

Match(ITypeDefOrRef?, MatchingContext)

Attempts to match the provided input to the pattern.

public override IMatchNode<ITypeDefOrRef?>? Match(ITypeDefOrRef? input, MatchingContext context)

Parameters

input ITypeDefOrRef

The input to match.

context MatchingContext

The 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

builder StringBuilder

Returns

bool

Operators

operator ==(TypeSpecificationPattern?, TypeSpecificationPattern?)

public static bool operator ==(TypeSpecificationPattern? left, TypeSpecificationPattern? right)

Parameters

left TypeSpecificationPattern
right TypeSpecificationPattern

Returns

bool

operator !=(TypeSpecificationPattern?, TypeSpecificationPattern?)

public static bool operator !=(TypeSpecificationPattern? left, TypeSpecificationPattern? right)

Parameters

left TypeSpecificationPattern
right TypeSpecificationPattern

Returns

bool