Class ContainerDescriptionExtensions
- Namespace
- NanoByte.StructureEditor.WinForms
- Assembly
- NanoByte.StructureEditor.WinForms.dll
Provides WinForms-specific extensions methods for IContainerDescription<TContainer>.
public static class ContainerDescriptionExtensions
- Inheritance
-
ContainerDescriptionExtensions
- Inherited Members
Methods
AddElement<TContainer, TList, TElement>(IListDescription<TContainer, TList>, string, Func<TElement>)
Adds a list element type to the description using PropertyGridNodeEditor<T>.
public static IListDescription<TContainer, TList> AddElement<TContainer, TList, TElement>(this IListDescription<TContainer, TList> description, string name, Func<TElement> factory) where TContainer : class where TList : class where TElement : class, TList, IEquatable<TElement>
Parameters
description
IListDescription<TContainer, TList>Describes an object that contains nodes (properties and/or lists).
name
stringThe name of the element type.
factory
Func<TElement>Callback to create a new instance of
TElement
.
Returns
- IListDescription<TContainer, TList>
The "this" pointer for use in a "Fluent API" style.
Type Parameters
TContainer
The type of the container containing the list.
TList
The type of elements in the list.
TElement
The type of a specific element type in the list.
AddPlainList<TContainer, TElement>(IContainerDescription<TContainer>, string, Func<TContainer, IList<TElement>>)
Adds a list with only one type of element to the description using PropertyGridNodeEditor<T>.
public static IContainerDescription<TContainer> AddPlainList<TContainer, TElement>(this IContainerDescription<TContainer> description, string name, Func<TContainer, IList<TElement>> getList) where TContainer : class where TElement : class, IEquatable<TElement>, new()
Parameters
description
IContainerDescription<TContainer>Describes an object that contains nodes (properties and/or lists).
name
stringThe name of the element type.
getList
Func<TContainer, IList<TElement>>A function to retrieve the list from the container.
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.
AddPlainList<TContainer, TElement>(IContainerDescription<TContainer>, string, Func<TContainer, IList<TElement>>, Func<TElement>)
Adds a list with only one type of element to the description using PropertyGridNodeEditor<T>.
public static IContainerDescription<TContainer> AddPlainList<TContainer, TElement>(this IContainerDescription<TContainer> description, string name, Func<TContainer, IList<TElement>> getList, Func<TElement> factory) where TContainer : class where TElement : class, IEquatable<TElement>
Parameters
description
IContainerDescription<TContainer>Describes an object that contains nodes (properties and/or lists).
name
stringThe name of the element type.
getList
Func<TContainer, IList<TElement>>A function to retrieve the list from the container.
factory
Func<TElement>Callback to create a new instance of
TElement
.
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.
AddProperty<TContainer, TProperty>(IContainerDescription<TContainer>, string, Func<TContainer, PropertyPointer<TProperty?>>)
Adds a property to the description using PropertyGridNodeEditor<T>.
public static IContainerDescription<TContainer> AddProperty<TContainer, TProperty>(this IContainerDescription<TContainer> description, string name, Func<TContainer, PropertyPointer<TProperty?>> getPointer) where TContainer : class where TProperty : class, IEquatable<TProperty>, new()
Parameters
description
IContainerDescription<TContainer>Describes an object that contains nodes (properties and/or lists).
name
stringThe name of the property.
getPointer
Func<TContainer, PropertyPointer<TProperty>>A function to retrieve a pointer to property in the container.
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.
AddProperty<TContainer, TProperty>(IContainerDescription<TContainer>, string, Func<TContainer, PropertyPointer<TProperty?>>, Func<TProperty>)
Adds a property to the description using PropertyGridNodeEditor<T>.
public static IContainerDescription<TContainer> AddProperty<TContainer, TProperty>(this IContainerDescription<TContainer> description, string name, Func<TContainer, PropertyPointer<TProperty?>> getPointer, Func<TProperty> factory) where TContainer : class where TProperty : class, IEquatable<TProperty>
Parameters
description
IContainerDescription<TContainer>Describes an object that contains nodes (properties and/or lists).
name
stringThe name of the property.
getPointer
Func<TContainer, PropertyPointer<TProperty>>A function to retrieve a pointer to property in the container.
factory
Func<TProperty>Callback to create a new instance of
TProperty
.
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.