NavigationRegionDeparture class

Namespace Runic.Navigation in Runic.Navigation 0.23.0

public sealed class NavigationRegionDeparture

Describes a departure from a region that a INavigationRegionGuard can veto. The navigator creates one for each guard invocation; it belongs to that invocation and to the transition that runs it.

Properties

Entries

public IReadOnlyList<NavigationEntryId> Entries { get; }

Gets the departing entries of NavigationRegionDeparture.Region, current first. For a guard of RunicNavigator.AddDepartureGuard, the departing entries of every region of the transition, deepest first.

Kind

public NavigationDepartureKind Kind { get; }

Gets NavigationDepartureKind.Retire when the transition retires a departing entry; otherwise NavigationDepartureKind.Retain.

ModelContext

public IRunicModelContext ModelContext { get; }

Gets the model context whose turns commit the navigator's state. Guards run outside model turns, so they read and change shared model state through IRunicModelContext.InvokeAsync.

Operation

public NavigationOperation Operation { get; }

Gets the requested operation.

Region

public NavigationRegion Region { get; }

Gets the departing region. For a guard of RunicNavigator.AddDepartureGuard, it is the region the request was made to, or for a request of a NavigationSelection, the region it leaves or removes.

Methods

OnCommitted

public void OnCommitted(Action action)

Runs action if, and only if, this transition commits, like NavigationDeparture.OnCommitted: in its commit turn, with the actions of the other guards in the order the guards were asked, so after those of the entries' guards unless the guard is asked NavigationRegionGuardOrder.BeforeEntries.

Parameters

action

The action to run in the commit turn.

Exceptions

InvalidOperationException

The guard's task has already completed.

ToString

public override string ToString()

Inherits documentation from Object.ToString.