Table of Contents

Class MethodResult

Namespace
SampSharp.Entities
Assembly
SampSharp.OpenMp.Entities.dll

Boxed boolean event-handler return value. SampSharp.Entities.EventDispatcher's invokers convert bool-returning handlers to MethodResult so the dispatcher can distinguish "explicit false" from "no handler ran" (which is null). Public so middlewares can interpret the truthiness of an upstream result.

public sealed record MethodResult : IEquatable<MethodResult>
Inheritance
MethodResult
Implements
Inherited Members

Constructors

MethodResult(bool)

Boxed boolean event-handler return value. SampSharp.Entities.EventDispatcher's invokers convert bool-returning handlers to MethodResult so the dispatcher can distinguish "explicit false" from "no handler ran" (which is null). Public so middlewares can interpret the truthiness of an upstream result.

public MethodResult(bool Value)

Parameters

Value bool

Properties

False

Singleton "false" instance.

public static MethodResult False { get; }

Property Value

MethodResult

True

Singleton "true" instance.

public static MethodResult True { get; }

Property Value

MethodResult

Value

public bool Value { get; init; }

Property Value

bool

Methods

Deconstruct(out bool)

public void Deconstruct(out bool Value)

Parameters

Value bool

Equals(MethodResult?)

public bool Equals(MethodResult? other)

Parameters

other MethodResult

Returns

bool

Equals(object?)

public override bool Equals(object? obj)

Parameters

obj object

Returns

bool

From(bool)

Returns the singleton MethodResult for the given value.

public static object From(bool value)

Parameters

value bool

Returns

object

GetHashCode()

public override int GetHashCode()

Returns

int

ToString()

public override string ToString()

Returns

string

Operators

operator ==(MethodResult?, MethodResult?)

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

Parameters

left MethodResult
right MethodResult

Returns

bool

operator !=(MethodResult?, MethodResult?)

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

Parameters

left MethodResult
right MethodResult

Returns

bool