New to Telerik UI for WinFormsStart a free 30-day trial

The generic container generator.

Definition

Namespace:Telerik.Windows.Diagrams.Core

Assembly:Telerik.WinControls.RadDiagram.dll

Type Parameters:

T

The type being generated for a given item.

Syntax:

C#
public class GenericContainerGenerator<T> : IContainerGeneratorInternal<T>, IContainerGenerator<T>, IContainerGeneratorInternal, IContainerGenerator

Inheritance: objectGenericContainerGenerator<T>

Implements: IContainerGeneratorIContainerGenerator<T>IContainerGeneratorInternalIContainerGeneratorInternal<T>

Constructors

Initializes a new instance of the GenericContainerGenerator<T> class.

C#
public GenericContainerGenerator(ISupportContainerGenerator<T> host)
Parameters:hostISupportContainerGenerator<T>

The host.

Properties

The generation status of the GenericContainerGenerator.

C#
public GeneratorStatus Status { get; }

Implements: IContainerGenerator.Status

Methods

Clears the recycled containers cache.

C#
public void ClearCache()

Implements: IContainerGeneratorInternal<T>.ClearCache()

Returns the container for the given item.

C#
public T ContainerFromItem(object item)
Parameters:itemobject

The item for which the container should be returned.

Returns:

T

The container or null if the container hasn't been generated.

Implements: IContainerGenerator<T>.ContainerFromItem(object)

Remarks:

Use the GenerateContainer(object) method to generate a container for the item.

Generates the connection container.

C#
public T GenerateConnectionContainer(IShape source, IShape target)
Parameters:sourceIShape

The source.

targetIShape

The target.

Returns:

T

Implements: IContainerGeneratorInternal<T>.GenerateConnectionContainer(IShape, IShape)

Generates the container for the given item.

C#
public T GenerateContainer(object item)
Parameters:itemobject

The item.

Returns:

T

Implements: IContainerGeneratorInternal<T>.GenerateContainer(object)

Remarks:
  • If the item is an IShape or an IConnection then the item is its own container.
  • If the item implements the ILink interface an IConnection will be returned.
  • A generic object (like a string or a control) will have an IShape as container and the item will be put in the Content.

Generates the containers.

C#
public IEnumerable<T> GenerateContainers(IEnumerable items)
Parameters:itemsIEnumerable

The items.

Returns:

IEnumerable<T>

Implements: IContainerGeneratorInternal<T>.GenerateContainers(IEnumerable)

Generates a geometry shape container.

C#
public T GenerateGeometryShapeContainer()
Returns:

T

Returns the item for a specific container.

C#
public object ItemFromContainer(T container)
Parameters:containerT

The container.

Returns:

object

Implements: IContainerGenerator<T>.ItemFromContainer(T)

Maps the item to container.

C#
public void MapItemToContainer(object item, T container)
Parameters:itemobject

The item.

containerT

The container.

Implements: IContainerGeneratorInternal<T>.MapItemToContainer(object, T)

Maps the item to a recycled container.

C#
public void MapItemToRecycledContainer(object item, T container)
Parameters:itemobject

The item.

containerT

The recycled container.

Implements: IContainerGeneratorInternal<T>.MapItemToRecycledContainer(object, T)

Raises the status changed event.

C#
protected virtual void OnStatusChanged()

Removes the container.

C#
public void RemoveContainer(T container)
Parameters:containerT

The container.

Implements: IContainerGeneratorInternal<T>.RemoveContainer(T)

Removes the item.

C#
public void RemoveItem(object item)
Parameters:itemobject

The item.

Implements: IContainerGeneratorInternal.RemoveItem(object)

Events

The StatusChanged event is raised by a view generator to inform controls that its status has changed.

C#
public event EventHandler StatusChanged

Implements: IContainerGenerator.StatusChanged