Class EventSpec
- Namespace
- AsmLocator
- Assembly
- AsmLocator.dll
Describes constraints used to match an event definition.
public sealed record EventSpec : IEquatable<EventSpec>
- Inheritance
-
EventSpec
- Implements
- Inherited Members
Constructors
EventSpec()
public EventSpec()
Properties
Attribute
The custom attribute type full-name matcher.
public StringMatcher? Attribute { get; init; }
Property Value
EventType
The event type full-name matcher.
public StringMatcher? EventType { get; init; }
Property Value
Name
The member name matcher. When null, the name is not used as a constraint.
public StringMatcher? Name { get; init; }
Property Value
Where
An optional custom predicate applied after the built-in constraints.
public Func<EventDefinition, bool>? Where { get; init; }
Property Value
Methods
ByName(StringMatcher)
Creates a specification constrained by member name.
public static EventSpec ByName(StringMatcher name)
Parameters
nameStringMatcherThe name matcher for the target member.
Returns
- EventSpec
A new specification with the described constraints.
Equals(EventSpec?)
public bool Equals(EventSpec? other)
Parameters
otherEventSpec
Returns
Equals(object?)
public override bool Equals(object? obj)
Parameters
objobject
Returns
GetHashCode()
public override int GetHashCode()
Returns
Matches(EventDefinition)
Returns whether the supplied candidate satisfies all constraints configured in this specification.
public bool Matches(EventDefinition ev)
Parameters
evEventDefinitionThe candidate AsmResolver event definition.
Returns
Of(StringMatcher, StringMatcher?)
When only a name is supplied, matches by name; when an event type is supplied, also matches its type.
public static EventSpec Of(StringMatcher name, StringMatcher? eventType = null)
Parameters
nameStringMatcherThe name matcher for the target member.
eventTypeStringMatcherAn optional matcher for the event type full name.
Returns
- EventSpec
A new specification with the described constraints.
ToString()
Returns a readable representation of this object.
public override string ToString()
Returns
- string
A readable description.
Operators
operator ==(EventSpec?, EventSpec?)
public static bool operator ==(EventSpec? left, EventSpec? right)
Parameters
Returns
implicit operator EventSpec(string)
Converts a string into a EventSpec that matches the event name.
public static implicit operator EventSpec(string name)
Parameters
namestringThe name matcher for the target member.
Returns
- EventSpec
The specification created from the supplied string.
operator !=(EventSpec?, EventSpec?)
public static bool operator !=(EventSpec? left, EventSpec? right)