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
descriptionIContainerDescription<TContainer>Describes an object that contains nodes (properties and/or lists).
namestringThe name of the element type.
getListFunc<TContainer, IList<TElement>>A function to retrieve the list from the container.
editorTEditor
Returns
- IContainerDescription<TContainer>
The "this" pointer for use in a "Fluent API" style.
Type Parameters
TContainerThe type of the container containing the list.
TElementThe type of elements in the list.
TEditorAn 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
descriptionIContainerDescription<TContainer>Describes an object that contains nodes (properties and/or lists).
namestringThe name of the property.
getPointerFunc<TContainer, PropertyPointer<TProperty>>A function to retrieve a pointer to property in the container.
editorTEditorDummy element used for type inference of
TEditor.
Returns
- IContainerDescription<TContainer>
The "this" pointer for use in a "Fluent API" style.
Type Parameters
TContainerThe type of the container containing the property.
TPropertyThe type of the property.
TEditorAn editor for modifying the content of the property.