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
descriptionIListDescription<TContainer, TList>Describes an object that contains nodes (properties and/or lists).
namestringThe name of the element type.
factoryFunc<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
TContainerThe type of the container containing the list.
TListThe type of elements in the list.
TElementThe 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
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.
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.
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
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.
factoryFunc<TElement>Callback to create a new instance of
TElement.
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.
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
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.
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.
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
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.
factoryFunc<TProperty>Callback to create a new instance of
TProperty.
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.