Table of Contents

Class ModuleTypePattern

Namespace
CilFi.Patterns
Assembly
CilFi.Core.dll

Defines the pattern matching on module or global types in a .NET module.

public record ModuleTypePattern : Pattern<ITypeDefOrRef?>, IEquatable<Pattern>, IEquatable<Pattern<ITypeDefOrRef?>>, IEquatable<ModuleTypePattern>
Inheritance
ModuleTypePattern
Implements
Inherited Members
Extension Methods

Constructors

ModuleTypePattern()

public ModuleTypePattern()

ModuleTypePattern(ModuleTypePattern)

protected ModuleTypePattern(ModuleTypePattern original)

Parameters

original ModuleTypePattern

Properties

EqualityContract

protected override Type EqualityContract { get; }

Property Value

Type

Instance

Gets the singleton instance of the ModuleTypePattern class.

public static ModuleTypePattern Instance { get; }

Property Value

ModuleTypePattern

Methods

Equals(ModuleTypePattern?)

public virtual bool Equals(ModuleTypePattern? other)

Parameters

other ModuleTypePattern

Returns

bool

Equals(Pattern<ITypeDefOrRef?>?)

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

Parameters

other Pattern<ITypeDefOrRef>

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 ==(ModuleTypePattern?, ModuleTypePattern?)

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

Parameters

left ModuleTypePattern
right ModuleTypePattern

Returns

bool

operator !=(ModuleTypePattern?, ModuleTypePattern?)

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

Parameters

left ModuleTypePattern
right ModuleTypePattern

Returns

bool