Class ParameterPattern
Defines the pattern matching on parameters defined by a .NET method.
[GenerateKeyedMatchNode]
public record ParameterPattern : Pattern<Parameter>, IEquatable<Pattern>, IEquatable<Pattern<Parameter>>, IEquatable<ParameterPattern>
- Inheritance
-
ParameterPattern
- Implements
- Inherited Members
Constructors
ParameterPattern(ParameterPattern)
protected ParameterPattern(ParameterPattern original)
Parameters
originalParameterPattern
ParameterPattern(Pattern<TypeSignature>, Pattern<string?>)
Defines the pattern matching on parameters defined by a .NET method.
public ParameterPattern(Pattern<TypeSignature> ParameterType, Pattern<string?> Name)
Parameters
ParameterTypePattern<TypeSignature>The pattern describing the type of the parameter.
NamePattern<string>The pattern describing the name of the parameter.
Properties
EqualityContract
protected override Type EqualityContract { get; }
Property Value
Name
The pattern describing the name of the parameter.
public Pattern<string?> Name { get; init; }
Property Value
ParameterType
The pattern describing the type of the parameter.
public Pattern<TypeSignature> ParameterType { get; init; }
Property Value
Methods
Deconstruct(out Pattern<TypeSignature>, out Pattern<string?>)
public void Deconstruct(out Pattern<TypeSignature> ParameterType, out Pattern<string?> Name)
Parameters
ParameterTypePattern<TypeSignature>NamePattern<string>
Equals(ParameterPattern?)
public virtual bool Equals(ParameterPattern? other)
Parameters
otherParameterPattern
Returns
Equals(Pattern<Parameter>?)
public override sealed bool Equals(Pattern<Parameter>? other)
Parameters
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(Parameter, MatchingContext)
Attempts to match the provided input to the pattern.
public override IMatchNode<Parameter>? Match(Parameter input, MatchingContext context)
Parameters
inputParameterThe input to match.
contextMatchingContextThe context in which to match the pattern to.
Returns
- IMatchNode<Parameter>
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 ==(ParameterPattern?, ParameterPattern?)
public static bool operator ==(ParameterPattern? left, ParameterPattern? right)
Parameters
leftParameterPatternrightParameterPattern
Returns
operator !=(ParameterPattern?, ParameterPattern?)
public static bool operator !=(ParameterPattern? left, ParameterPattern? right)
Parameters
leftParameterPatternrightParameterPattern