Class
DiagramToGraphAdapter<TNodeData, TLinkData>

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:

cs-api-definition
public sealed class DiagramToGraphAdapter<TNodeData, TLinkData> where TNodeData : new() where TLinkData : new()

Inheritance: objectDiagramToGraphAdapter<TNodeData, TLinkData>

Constructors

DiagramToGraphAdapter()

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

Declaration

cs-api-definition
public DiagramToGraphAdapter()

DiagramToGraphAdapter(IGraph, bool, bool)

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

Declaration

cs-api-definition
public DiagramToGraphAdapter(IGraph diagramControl, bool ignoreInvisible = true, bool ignoreContainers = false)

Parameters

diagramControl

IGraph

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

ignoreInvisible

bool

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

ignoreContainers

bool

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

IgnoredConnections

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

Declaration

cs-api-definition
public IList<IConnection> IgnoredConnections { get; }

Property Value

IList<IConnection>

IgnoredShapes

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

Declaration

cs-api-definition
public IList<IShape> IgnoredShapes { get; }

Property Value

IList<IShape>

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

Declaration

cs-api-definition
[SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")]
public IList<Edge<TNodeData, TLinkData>> Links { get; }

Property Value

IList<Edge<TNodeData, TLinkData>>

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

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

Declaration

cs-api-definition
[SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")]
public IList<Node<TNodeData, TLinkData>> Nodes { get; }

Property Value

IList<Node<TNodeData, TLinkData>>

Methods

Convert(IGraph, bool, bool)

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

Declaration

cs-api-definition
public void Convert(IGraph diagram, bool ignoreInvisible = true, bool ignoreContainers = false)

Parameters

diagram

IGraph

The diagram from which graph analytical information should be extracted.

ignoreInvisible

bool

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

ignoreContainers

bool

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.

GetNode(IShape)

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

Declaration

cs-api-definition
public Node<TNodeData, TLinkData> GetNode(IShape shape)

Parameters

shape

IShape

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

Returns

Node<TNodeData, TLinkData>

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

Map(IConnection)

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

Declaration

cs-api-definition
public Edge<TNodeData, TLinkData> Map(IConnection connection)

Parameters

connection

IConnection

The connection.

Returns

Edge<TNodeData, TLinkData>

Map(IShape)

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

Declaration

cs-api-definition
public Node<TNodeData, TLinkData> Map(IShape shape)

Parameters

shape

IShape

The shape.

Returns

Node<TNodeData, TLinkData>