Table of Contents

Interface IPropertyDescription<TContainer, TProperty>

Namespace
NanoByte.StructureEditor
Assembly
NanoByte.StructureEditor.dll

Exposes methods for configuring a polymorphic single-value property in a ContainerDescription<TContainer> in a Fluent API style.

public interface IPropertyDescription<TContainer, TProperty> where TContainer : class where TProperty : class

Type Parameters

TContainer

The type of the container containing the property.

TProperty

The base type of the property.

Methods

AddElement<TElement, TEditor>(string, Func<TElement>, TEditor)

Adds a property value type to the description.

[SuppressMessage("Microsoft.Design", "CA1004:GenericMethodsShouldProvideTypeParameter", Justification = "Generics used as type-safe reflection replacement.")]
IPropertyDescription<TContainer, TProperty> AddElement<TElement, TEditor>(string name, Func<TElement> factory, TEditor editor) where TElement : class, TProperty, IEquatable<TElement> where TEditor : INodeEditor<TElement>, new()

Parameters

name string

The name of the value type.

factory Func<TElement>

Callback to create a new instance of TElement.

editor TEditor

Dummy element used for type inference of TEditor.

Returns

IPropertyDescription<TContainer, TProperty>

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

Type Parameters

TElement

A specific type the property value can have.

TEditor

An editor for modifying this type of value.