ILWeaverResult Class
Definition
Section titled “Definition”A result value sometimes returned by ILWeaver containing status on action through IsValid. If IsValid is false, FailureMessage has a value.
public class ILWeaverResultInheritance object
Constructors
Section titled “Constructors”ILWeaverResult(ILWeaver, Func<string>?)
Section titled “ILWeaverResult(ILWeaver, Func<string>?)”Constructs a new ILWeaverResult for the select ILWeaver. If failureMessage is left null, the result is success; otherwise failure.
public ILWeaverResult(ILWeaver weaver, Func<string>? failureMessage)Parameters
Section titled “Parameters”weaver ILWeaver
The ILWeaver who this result is connected to.
failureMessage Func<string>
A delegate returning the failure message if the result is a failure, or null if it was a success.
Properties
Section titled “Properties”IsValid
Section titled “IsValid”Returns the state of the result.
[MemberNotNullWhen(false, "FailureMessage")]public bool IsValid { get; }FailureMessage
Section titled “FailureMessage”A message containing the details of what went wrong if IsValid is false.
public string? FailureMessage { get; }Methods
Section titled “Methods”ThrowIfFailure()
Section titled “ThrowIfFailure()”Throws if the previous action was not successful.
For checking if the action was valid without throwing, see IsValid or Extract(out ILWeaverResult).
public ILWeaver ThrowIfFailure()Returns
Section titled “Returns”Exceptions
Section titled “Exceptions”Extract(out ILWeaverResult)
Section titled “Extract(out ILWeaverResult)”Outputs this ILWeaverResult. This method exists to allow more fluent chaining of the ILWeaver methods.
public ILWeaver Extract(out ILWeaverResult result)Parameters
Section titled “Parameters”result ILWeaverResult