Show / Hide Table of Contents

Class ContainerDescriptionExtensions

Provides WinForms-specific extensions methods for IContainerDescription<TContainer>.

Inheritance
Object
ContainerDescriptionExtensions
Namespace: NanoByte.StructureEditor.WinForms
Assembly: NanoByte.StructureEditor.WinForms.dll
Syntax
public static class ContainerDescriptionExtensions : Object

Methods

AddElement<TContainer, TList, TElement>(IListDescription<TContainer, TList>, String, Func<TElement>)

Adds a list element type to the description using PropertyGridNodeEditor<T>.

Declaration
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
Type Name Description
IListDescription<TContainer, TList> description

Describes an object that contains nodes (properties and/or lists).

String name

The name of the element type.

Func<TElement> factory

Callback to create a new instance of TElement.

Returns
Type Description
IListDescription<TContainer, TList>

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

Type Parameters
Name Description
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>.

Declaration
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
Type Name Description
IContainerDescription<TContainer> description

Describes an object that contains nodes (properties and/or lists).

String name

The name of the element type.

Func<TContainer, IList<TElement>> getList

A function to retrieve the list from the container.

Returns
Type Description
IContainerDescription<TContainer>

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

Type Parameters
Name Description
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>.

Declaration
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
Type Name Description
IContainerDescription<TContainer> description

Describes an object that contains nodes (properties and/or lists).

String name

The name of the element type.

Func<TContainer, IList<TElement>> getList

A function to retrieve the list from the container.

Func<TElement> factory

Callback to create a new instance of TElement.

Returns
Type Description
IContainerDescription<TContainer>

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

Type Parameters
Name Description
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>.

Declaration
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
Type Name Description
IContainerDescription<TContainer> description

Describes an object that contains nodes (properties and/or lists).

String name

The name of the property.

Func<TContainer, PropertyPointer<TProperty>> getPointer

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

Returns
Type Description
IContainerDescription<TContainer>

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

Type Parameters
Name Description
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>.

Declaration
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
Type Name Description
IContainerDescription<TContainer> description

Describes an object that contains nodes (properties and/or lists).

String name

The name of the property.

Func<TContainer, PropertyPointer<TProperty>> getPointer

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

Func<TProperty> factory

Callback to create a new instance of TProperty.

Returns
Type Description
IContainerDescription<TContainer>

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

Type Parameters
Name Description
TContainer

The type of the container containing the property.

TProperty

The type of the property.

In This Article
Back to top Copyright Bastian Eicher