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

Helper class to extract a Graph<TNodeData, TLinkData> from an IGraph structure (usually the RadDiagram control).

Definition

Namespace:Telerik.Windows.Diagrams.Core

Assembly:Telerik.Windows.Diagrams.Core.dll

Type Parameters:

TNodeData

TLinkData

Syntax:

C#
public sealed class DiagramToGraphAdapter<TNodeData, TLinkData> where TNodeData : new() where TLinkData : new()

Inheritance: objectDiagramToGraphAdapter<TNodeData, TLinkData>

Constructors

Initializes a new instance of the DiagramToGraphAdapter<TNodeData, TLinkData> class.

C#
public DiagramToGraphAdapter()

Initializes a new instance of the DiagramToGraphAdapter<TNodeData, TLinkData> class.

C#
public DiagramToGraphAdapter(IGraph diagramControl, bool ignoreInvisible = true, bool ignoreContainers = false)
Parameters:diagramControlIGraph

The diagram control which should be mapped to its graph-analytical analog.

ignoreInvisiblebool

If set to true shapes with Visibility not set to Visible will be ignored.

ignoreContainersbool

If set to true shape containers will not be taken into account and all children inside a (possibly nested) container will be organized independently of their parent container as part of the global layout.

Properties

Gets the connections which are being ignored because of graph analytical reasons.

C#
public IList<IConnection> IgnoredConnections { get; }

Gets the shapes which are being ignored because of graph analytical reasons. Ignored shapes are not mapped to a Node<TNodeData, TLinkData>.

C#
public IList<IShape> IgnoredShapes { get; }

IList<Edge<TNodeData, TLinkData>>

Gets the collection of Edge<TNodeData, TLinkData> items corresponding to the Connections items.

C#
public IList<Edge<TNodeData, TLinkData>> Links { get; }
Remarks:

Note that the this collection can be a reduced set of the original Connections set. The omitted items can be found in the IgnoredConnections collection.

Nodes

IList<Node<TNodeData, TLinkData>>

Gets the collection of Node<TNodeData, TLinkData> items corresponding to the Shapes items.

C#
public IList<Node<TNodeData, TLinkData>> Nodes { get; }

Methods

Converts the given diagram to a Graph<TNodeData, TLinkData>.

C#
public void Convert(IGraph diagram, bool ignoreInvisible = true, bool ignoreContainers = false)
Parameters:diagramIGraph

The diagram from which graph analytical information should be extracted.

ignoreInvisiblebool

If set to true shapes with Visibility not set to Visible will be ignored.

ignoreContainersbool

If set to true shape containers will not be taken into account and all children inside a (possibly nested) container will be organized independently of their parent container as part of the global layout.

Creates a Node<TNodeData, TLinkData> from a given IShape.

C#
public Node<TNodeData, TLinkData> GetNode(IShape shape)
Parameters:shapeIShape

The shape which should be mapped to a Node<TNodeData, TLinkData>.

Returns:

Node<TNodeData, TLinkData>

The Node<TNodeData, TLinkData> corresponding to the given shape.

Maps the specified connection to an edge of the graph deduced from the given diagram.

C#
public Edge<TNodeData, TLinkData> Map(IConnection connection)
Parameters:connectionIConnection

The connection.

Returns:

Edge<TNodeData, TLinkData>

Maps the specified shape to a node of the graph deduced from the given diagram.

C#
public Node<TNodeData, TLinkData> Map(IShape shape)
Parameters:shapeIShape

The shape.

Returns:

Node<TNodeData, TLinkData>