Table of Contents

Class ContainerDescriptionExtensions

Namespace
NanoByte.StructureEditor
Assembly
NanoByte.StructureEditor.dll

Provides extensions methods for IContainerDescription<TContainer>.

public static class ContainerDescriptionExtensions
Inheritance
ContainerDescriptionExtensions
Inherited Members

Methods

AddPlainList<TContainer, TElement, TEditor>(IContainerDescription<TContainer>, string, Func<TContainer, IList<TElement>>, TEditor)

Adds a list with only one type of element to the description.

public static IContainerDescription<TContainer> AddPlainList<TContainer, TElement, TEditor>(this IContainerDescription<TContainer> description, string name, Func<TContainer, IList<TElement>> getList, TEditor editor) where TContainer : class where TElement : class, IEquatable<TElement>, new() where TEditor : INodeEditor<TElement>, new()

Parameters

description IContainerDescription<TContainer>

Describes an object that contains nodes (properties and/or lists).

name string

The name of the element type.

getList Func<TContainer, IList<TElement>>

A function to retrieve the list from the container.

editor TEditor

Returns

IContainerDescription<TContainer>

The "this" pointer for use in a "Fluent API" style.

Type Parameters

TContainer

The type of the container containing the list.

TElement

The type of elements in the list.

TEditor

An editor for modifying the content of the property.

AddProperty<TContainer, TProperty, TEditor>(IContainerDescription<TContainer>, string, Func<TContainer, PropertyPointer<TProperty?>>, TEditor)

Adds a property to the description.

public static IContainerDescription<TContainer> AddProperty<TContainer, TProperty, TEditor>(this IContainerDescription<TContainer> description, string name, Func<TContainer, PropertyPointer<TProperty?>> getPointer, TEditor editor) where TContainer : class where TProperty : class, IEquatable<TProperty>, new() where TEditor : INodeEditor<TProperty>, new()

Parameters

description IContainerDescription<TContainer>

Describes an object that contains nodes (properties and/or lists).

name string

The name of the property.

getPointer Func<TContainer, PropertyPointer<TProperty>>

A function to retrieve a pointer to property in the container.

editor TEditor

Dummy element used for type inference of TEditor.

Returns

IContainerDescription<TContainer>

The "this" pointer for use in a "Fluent API" style.

Type Parameters

TContainer

The type of the container containing the property.

TProperty

The type of the property.

TEditor

An editor for modifying the content of the property.