Table of Contents

Class FieldDescriptorPattern

Namespace
CilFi.Patterns
Assembly
CilFi.Core.dll

Defines the pattern matching on field descriptors.

[GenerateKeyedMatchNode]
public record FieldDescriptorPattern : Pattern<IFieldDescriptor>, IEquatable<Pattern>, IEquatable<Pattern<IFieldDescriptor>>, IEquatable<FieldDescriptorPattern>
Inheritance
FieldDescriptorPattern
Implements
Inherited Members

Constructors

FieldDescriptorPattern(FieldDescriptorPattern)

protected FieldDescriptorPattern(FieldDescriptorPattern original)

Parameters

original FieldDescriptorPattern

FieldDescriptorPattern(Pattern<TypeSignature>, Pattern<ITypeDefOrRef?>, Pattern<string?>)

Defines the pattern matching on field descriptors.

public FieldDescriptorPattern(Pattern<TypeSignature> FieldType, Pattern<ITypeDefOrRef?> DeclaringType, Pattern<string?> Name)

Parameters

FieldType Pattern<TypeSignature>

The pattern describing the field type.

DeclaringType Pattern<ITypeDefOrRef>

The pattern describing the type declaring the field.

Name Pattern<string>

The pattern describing the name of the field.

Fields

AnyField

Defines the pattern for any valid field descriptor.

public static readonly Pattern<IFieldDescriptor> AnyField

Field Value

Pattern<IFieldDescriptor>

Properties

DeclaringType

The pattern describing the type declaring the field.

public Pattern<ITypeDefOrRef?> DeclaringType { get; init; }

Property Value

Pattern<ITypeDefOrRef>

EqualityContract

protected override Type EqualityContract { get; }

Property Value

Type

FieldType

The pattern describing the field type.

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

Property Value

Pattern<TypeSignature>

Name

The pattern describing the name of the field.

public Pattern<string?> Name { get; init; }

Property Value

Pattern<string>

Methods

Deconstruct(out Pattern<TypeSignature>, out Pattern<ITypeDefOrRef?>, out Pattern<string?>)

public void Deconstruct(out Pattern<TypeSignature> FieldType, out Pattern<ITypeDefOrRef?> DeclaringType, out Pattern<string?> Name)

Parameters

FieldType Pattern<TypeSignature>
DeclaringType Pattern<ITypeDefOrRef>
Name Pattern<string>

Equals(FieldDescriptorPattern?)

public virtual bool Equals(FieldDescriptorPattern? other)

Parameters

other FieldDescriptorPattern

Returns

bool

Equals(Pattern<IFieldDescriptor>?)

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

Parameters

other Pattern<IFieldDescriptor>

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(IFieldDescriptor, MatchingContext)

Attempts to match the provided input to the pattern.

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

Parameters

input IFieldDescriptor

The input to match.

context MatchingContext

The context in which to match the pattern to.

Returns

IMatchNode<IFieldDescriptor>

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

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

Parameters

left FieldDescriptorPattern
right FieldDescriptorPattern

Returns

bool

operator !=(FieldDescriptorPattern?, FieldDescriptorPattern?)

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

Parameters

left FieldDescriptorPattern
right FieldDescriptorPattern

Returns

bool