Show / Hide Table of Contents

Class AnonymousActionRenderer<T>

An IActionRenderer<T> that invokes its callbacks. In other words, this is an IActionRenderer<T> version of AnonymousRenderer<T>.

This class is useful when you want an one-use ad-hoc implementation (i.e., Java-style anonymous class) of IActionRenderer<T> interface.

Inheritance
Object
AnonymousRenderer<T>
AnonymousActionRenderer<T>
Implements
IActionRenderer<T>
IRenderer<T>
Inherited Members
AnonymousRenderer<T>.BlockRenderer
AnonymousRenderer<T>.ReorgRenderer
AnonymousRenderer<T>.ReorgEndRenderer
AnonymousRenderer<T>.RenderBlock(Block<T>, Block<T>)
AnonymousRenderer<T>.RenderReorg(Block<T>, Block<T>, Block<T>)
AnonymousRenderer<T>.RenderReorgEnd(Block<T>, Block<T>, Block<T>)
Namespace: Libplanet.Blockchain.Renderers
Assembly: Libplanet.dll
Syntax
public sealed class AnonymousActionRenderer<T> : AnonymousRenderer<T>, IActionRenderer<T>, IRenderer<T> where T : IAction, new()
Type Parameters
Name Description
T

An IAction type. It should match to BlockChain<T>'s type parameter.

Examples

With object initializers, you can easily make an one-use action renderer:

var actionRenderer = new AnonymousActionRenderer<ExampleAction>
{
    ActionRenderer = (action, context, nextStates) =>
    {
        // Implement RenderAction() here.
    };
};

Properties

| Improve this Doc View Source

ActionErrorRenderer

A callback function to be invoked together with RenderActionError(IAction, IActionContext, Exception).

Declaration
public Action<IAction, IActionContext, Exception>? ActionErrorRenderer { get; set; }
Property Value
Type Description
Nullable<Libplanet.Action<IAction, IActionContext, Exception>>
| Improve this Doc View Source

ActionErrorUnrenderer

A callback function to be invoked together with UnrenderActionError(IAction, IActionContext, Exception).

Declaration
public Action<IAction, IActionContext, Exception>? ActionErrorUnrenderer { get; set; }
Property Value
Type Description
Nullable<Libplanet.Action<IAction, IActionContext, Exception>>
| Improve this Doc View Source

ActionRenderer

A callback function to be invoked together with RenderAction(IAction, IActionContext, IAccountStateDelta).

Declaration
public Action<IAction, IActionContext, IAccountStateDelta>? ActionRenderer { get; set; }
Property Value
Type Description
Nullable<Libplanet.Action<IAction, IActionContext, IAccountStateDelta>>
| Improve this Doc View Source

ActionUnrenderer

A callback function to be invoked together with UnrenderAction(IAction, IActionContext, IAccountStateDelta).

Declaration
public Action<IAction, IActionContext, IAccountStateDelta>? ActionUnrenderer { get; set; }
Property Value
Type Description
Nullable<Libplanet.Action<IAction, IActionContext, IAccountStateDelta>>
| Improve this Doc View Source

BlockEndRenderer

A callback function to be invoked together with RenderBlockEnd(Block<T>, Block<T>).

Declaration
public Action<Block<T>, Block<T>>? BlockEndRenderer { get; set; }
Property Value
Type Description
Nullable<Libplanet.Action<Block<T>, Block<T>>>

Methods

| Improve this Doc View Source

RenderAction(IAction, IActionContext, IAccountStateDelta)

Declaration
public void RenderAction(IAction action, IActionContext context, IAccountStateDelta nextStates)
Parameters
Type Name Description
IAction action
IActionContext context
IAccountStateDelta nextStates
| Improve this Doc View Source

RenderActionError(IAction, IActionContext, Exception)

Declaration
public void RenderActionError(IAction action, IActionContext context, Exception exception)
Parameters
Type Name Description
IAction action
IActionContext context
Exception exception
| Improve this Doc View Source

RenderBlockEnd(Block<T>, Block<T>)

Declaration
public void RenderBlockEnd(Block<T> oldTip, Block<T> newTip)
Parameters
Type Name Description
Block<T> oldTip
Block<T> newTip
| Improve this Doc View Source

UnrenderAction(IAction, IActionContext, IAccountStateDelta)

Declaration
public void UnrenderAction(IAction action, IActionContext context, IAccountStateDelta nextStates)
Parameters
Type Name Description
IAction action
IActionContext context
IAccountStateDelta nextStates
| Improve this Doc View Source

UnrenderActionError(IAction, IActionContext, Exception)

Declaration
public void UnrenderActionError(IAction action, IActionContext context, Exception exception)
Parameters
Type Name Description
IAction action
IActionContext context
Exception exception

Implements

IActionRenderer<T>
IRenderer<T>
  • Improve this Doc
  • View Source
Back to top Copyright © 2019–2020 Planetarium