Show / Hide Table of Contents

Class ContainerDescription<TContainer>

Describes an object that contains nodes (properties and/or lists). Provides information about how to edit this content.

Inheritance
Object
ContainerDescription<TContainer>
Implements
IContainerDescription<TContainer>
Namespace: NanoByte.StructureEditor
Assembly: NanoByte.StructureEditor.dll
Syntax
public class ContainerDescription<TContainer> : Object, IContainerDescription<TContainer> where TContainer : class
Type Parameters
Name Description
TContainer

The type of the container to be described.

Constructors

ContainerDescription()

Declaration
public ContainerDescription()

Methods

AddList<TList>(Func<TContainer, IList<TList>>)

Adds a list to the description.

Declaration
public IListDescription<TContainer, TList> AddList<TList>(Func<TContainer, IList<TList>> getList)
    where TList : class
Parameters
Type Name Description
Func<TContainer, IList<TList>> getList

A function to retrieve the list from the container.

Returns
Type Description
IListDescription<TContainer, TList>

A list description, enabling you to specify explicit sub-types of TList allowed in the list.

Type Parameters
Name Description
TList

The type of elements in the list.

AddPlainList<TElement, TEditor>(String, Func<TContainer, IList<TElement>>, TEditor)

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

Declaration
public IContainerDescription<TContainer> AddPlainList<TElement, TEditor>(string name, Func<TContainer, IList<TElement>> getList, TEditor editor)
    where TElement : class, IEquatable<TElement>, new()
    where TEditor : INodeEditor<TElement>, new()
Parameters
Type Name Description
String name

The name of the element type.

Func<TContainer, IList<TElement>> getList

A function to retrieve the list from the container.

TEditor editor

Dummy element used for type inference of TEditor.

Returns
Type Description
IContainerDescription<TContainer>

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

Type Parameters
Name Description
TElement

The type of elements in the list.

TEditor

An editor for modifying this type of element.

AddProperty<TProperty, TEditor>(String, Func<TContainer, PropertyPointer<TProperty>>, TEditor)

Adds a property to the description.

Declaration
public IContainerDescription<TContainer> AddProperty<TProperty, TEditor>(string name, Func<TContainer, PropertyPointer<TProperty>> getPointer, TEditor editor)
    where TProperty : class, IEquatable<TProperty>, new()
    where TEditor : INodeEditor<TProperty>, new()
Parameters
Type Name Description
String name

The name of the property.

Func<TContainer, PropertyPointer<TProperty>> getPointer

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

TEditor editor

Dummy element used for type inference of TEditor.

Returns
Type Description
IContainerDescription<TContainer>

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

Type Parameters
Name Description
TProperty

The type of the property.

TEditor

An editor for modifying the content of the property.

GetCandidatesFor(TContainer)

Returns information about possible new child nodes for a specific instance of TContainer.

Declaration
public IEnumerable<NodeCandidate> GetCandidatesFor(TContainer container)
Parameters
Type Name Description
TContainer container

The container instance to look at.

Returns
Type Description
IEnumerable<NodeCandidate>

GetNodesIn(TContainer)

Returns information about nodes found in a specific instance of TContainer.

Declaration
public IEnumerable<Node> GetNodesIn(TContainer container)
Parameters
Type Name Description
TContainer container

The container instance to look in to.

Returns
Type Description
IEnumerable<Node>

Implements

IContainerDescription<TContainer>
In This Article
Back to top Copyright Bastian Eicher