Show / Hide Table of Contents

Class AnonymousRenderer<T>

A renderer that invokes its callbacks.

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

Inheritance
Object
AnonymousRenderer<T>
AnonymousActionRenderer<T>
Implements
IRenderer<T>
Namespace: Libplanet.Blockchain.Renderers
Assembly: Libplanet.dll
Syntax
public class AnonymousRenderer<T> : object, 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 renderer:

var renderer = new AnonymousRenderer<ExampleAction>
{
    BlockRenderer = (oldTip, newTip) =>
    {
        // Implement RenderBlock() here.
    };
};

Properties

| Improve this Doc View Source

BlockRenderer

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

Declaration
public Action<Block<T>, Block<T>>? BlockRenderer { get; set; }
Property Value
Type Description
Nullable<Libplanet.Action<Block<T>, Block<T>>>
| Improve this Doc View Source

ReorgEndRenderer

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

Declaration
public Action<Block<T>, Block<T>, Block<T>>? ReorgEndRenderer { get; set; }
Property Value
Type Description
Nullable<Libplanet.Action<Block<T>, Block<T>, Block<T>>>
| Improve this Doc View Source

ReorgRenderer

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

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

Methods

| Improve this Doc View Source

RenderBlock(Block<T>, Block<T>)

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

RenderReorg(Block<T>, Block<T>, Block<T>)

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

RenderReorgEnd(Block<T>, Block<T>, Block<T>)

Declaration
public void RenderReorgEnd(Block<T> oldTip, Block<T> newTip, Block<T> branchpoint)
Parameters
Type Name Description
Block<T> oldTip
Block<T> newTip
Block<T> branchpoint

Implements

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