skip navigation
  • Product Bundles

    DevCraft

    All Telerik .NET tools and Kendo UI JavaScript components in one package. Now enhanced with:

    • NEW: Design Kits for Figma
    • Online Training
    • Document Processing Library
    • Embedded Reporting for web and desktop

    Web

    Kendo UI UI for jQuery UI for Angular UI for React UI for Vue UI for Blazor UI for ASP.NET Core UI for ASP.NET MVC UI for ASP.NET AJAX

    Mobile

    UI for .NET MAUI

    Document Management

    Telerik Document Processing

    Desktop

    UI for .NET MAUI UI for WinUI UI for WinForms UI for WPF

    Reporting

    Telerik Reporting Telerik Report Server

    Testing & Mocking

    Test Studio Test Studio Dev Edition Telerik JustMock

    CMS

    Sitefinity

    UI/UX Tools

    ThemeBuilder Design System Kit Templates and Building Blocks

    Debugging

    Fiddler Fiddler Everywhere Fiddler Classic Fiddler Everywhere Reporter FiddlerCore

    Free Tools

    VB.NET to C# Converter Testing Framework
    View all products
  • Overview
  • Demos
    • What's New
    • Roadmap
    • Release History
  • Support and Learning

    • Support and Learning Hub
    • First Steps
    • Docs
    • Demos
    • Virtual Classroom
    • Forums
    • Videos
    • Blogs
    • Accessibility
    • Submit a Ticket

    Productivity and Design Tools

    • Visual Studio Extensions
    • Visual Studio Templates
    • Embedded Reporting
  • Pricing
  • Shopping cart
    • Account Overview
    • Your Licenses
    • Downloads
    • Support Center
    • Forum Profile
    • Payment Methods
    • Edit Profile
    • Log out
  • Login
  • Contact Us
  • Try now

Class Node<TNodeData, TLinkData>

Default implementation of the Node<TNodeData, TLinkData> interface.

Inheritance
System.Object
Node<TNodeData, TLinkData>
TreeNode<TNode, TLink>
Namespace: Telerik.Windows.Diagrams.Core
Assembly: Telerik.Windows.Diagrams.Core.dll

Syntax

public class Node<TNodeData, TLinkData> : Object, INode<Node<TNodeData, TLinkData>, Edge<TNodeData, TLinkData>> where TNodeData : new()
    where TLinkData : new()
Type Parameters
TNodeData

The type of the payload.

TLinkData

The type of the link data.

Constructors

Node()

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

Declaration
public Node()

Node(Int32, Boolean)

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

Declaration
public Node(int id, bool isDirected)
Parameters
System.Int32 id

The identifier.

System.Boolean isDirected

If set to true the links are considered as directed and AllLinks is the same as the Outgoing or Incoming collections.

Node(IShape)

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

Declaration
public Node(IShape shape)
Parameters
IShape shape

The shape this node is based on.

Node(IShape, Boolean)

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

Declaration
public Node(IShape shape, bool isDirected)
Parameters
IShape shape

The shape.

System.Boolean isDirected

If set to true [is directed].

Properties

AllLinks

Gets all the links of this node.

Declaration
public IList<Edge<TNodeData, TLinkData>> AllLinks { get; }
Property Value
System.Collections.Generic.IList<Edge<TNodeData, TLinkData>>

Implements
INode<TNode, TLink>.AllLinks

AssociatedShape

Get the shape associated with this layout shape.

Declaration
public IShape AssociatedShape { get; protected set; }
Property Value
IShape

BoundingRectangle

Gets or sets the bounding rectangle of the shape.

Declaration
public Rect BoundingRectangle { get; set; }
Property Value
System.Windows.Rect

Implements
INode<TNode, TLink>.BoundingRectangle

Center

Gets or sets the geometric center of this ControlShape.

Declaration
public Point Center { get; set; }
Property Value
System.Windows.Point

Children

Gets the children nodes attached to this node.

Declaration
public IEnumerable<Node<TNodeData, TLinkData>> Children { get; }
Property Value
System.Collections.Generic.IEnumerable<Node<TNodeData, TLinkData>>

The children collection.

Implements
INode<TNode, TLink>.Children
Remarks
  • A child is defined as the opposite node from an edge starting at this node.
  • If the graph is not directed this will return the same collection as the Children and the Neighbors property, i.e. all the nodes attached to the this node.
See Also
Parents
Neighbors

Data

Gets or sets the data or payload carried by this node.

Declaration
public TNodeData Data { get; set; }
Property Value
TNodeData

The data.

Degree

Returns the total number of links attached.

Declaration
public int Degree { get; }
Property Value
System.Int32

Implements
INode<TNode, TLink>.Degree
See Also
AllLinks

Id

Gets or sets Id.

Declaration
public int Id { get; set; }
Property Value
System.Int32

Implements
INode<TNode, TLink>.Id

Incoming

Get the node's incoming links.

Declaration
public IList<Edge<TNodeData, TLinkData>> Incoming { get; protected set; }
Property Value
System.Collections.Generic.IList<Edge<TNodeData, TLinkData>>

Implements
INode<TNode, TLink>.Incoming
Remarks
  • If the node is directed (i.e. IsDirected = true) then this collection is the same as the AllLinks collection.
  • Do not add links to this collection but use the AddLink(TNode, TNode) method in order to update the related properties (AllLinks, Outgoing...).
See Also
AddLink(TNode, TNode)
Outgoing

IsDirected

Gets whether this node's links are directed.

Declaration
public bool IsDirected { get; set; }
Property Value
System.Boolean

true if this instance is directed; otherwise, false.

Implements
INode<TNode, TLink>.IsDirected
See Also
IsDirected

IsRoot

Gets or sets whether this node is a tree-root.

Declaration
public bool IsRoot { get; set; }
Property Value
System.Boolean

true if this instance is root; otherwise, false.

Implements
INode<TNode, TLink>.IsRoot
Remarks

This property only makes sense in a tree-context. Use a spanning tree algorithm to extract a tree from a generic graph if necessary.

IsVirtual

Gets or sets whether this node maps to a container or a collection of physical shapes.

Declaration
public bool IsVirtual { get; set; }
Property Value
System.Boolean

Neighbors

Gets the nodes adjacent to this node, i.e. both the Parents and Children nodes.

Declaration
public IEnumerable<Node<TNodeData, TLinkData>> Neighbors { get; }
Property Value
System.Collections.Generic.IEnumerable<Node<TNodeData, TLinkData>>

All the neighbors nodes of this node.

Implements
INode<TNode, TLink>.Neighbors
See Also
Parents
Children

Outgoing

Get the node's outgoing links.

Declaration
public IList<Edge<TNodeData, TLinkData>> Outgoing { get; set; }
Property Value
System.Collections.Generic.IList<Edge<TNodeData, TLinkData>>

Implements
INode<TNode, TLink>.Outgoing
Remarks
  • If the node is directed (i.e. IsDirected = true) then this collection is the same as the AllLinks collection.
  • Do not add links to this collection but use the AddLink(TNode, TNode) method in order to update the related properties (AllLinks, Outgoing...).
See Also
AddLink(TNode, TNode)
Incoming

Parents

Gets the parent nodes attached to this node.

Declaration
public IEnumerable<Node<TNodeData, TLinkData>> Parents { get; }
Property Value
System.Collections.Generic.IEnumerable<Node<TNodeData, TLinkData>>

The parent collection.

Implements
INode<TNode, TLink>.Parents
Remarks
  • A parent is defined as the opposite node from an edge ending at this node.
  • If the graph is not directed this will return the same collection as the Children and the Neighbors property, i.e. all the nodes attached to the this node.
See Also
Neighbors
Children

Methods

AddIncomingEdge(Edge<TNodeData, TLinkData>)

Adds an incoming link.

Declaration
public void AddIncomingEdge(Edge<TNodeData, TLinkData> edge)
Parameters
Edge<TNodeData, TLinkData> edge

The link to add.

Implements
INode<TNode, TLink>.AddIncomingEdge(TLink)

AddOutgoingEdge(Edge<TNodeData, TLinkData>)

Adds an outgoing link.

Declaration
public void AddOutgoingEdge(Edge<TNodeData, TLinkData> edge)
Parameters
Edge<TNodeData, TLinkData> edge

The link to add.

Implements
INode<TNode, TLink>.AddOutgoingEdge(TLink)

Clone()

Returns a (shallow) copy of this node.

Declaration
public Node<TNodeData, TLinkData> Clone()
Returns
Node<TNodeData, TLinkData>

Returns a copy of this node, including the references of incoming and outgoing edges. It does not however clone beyond these collections.

Implements
INode<TNode, TLink>.Clone()

GetBoundsFromAssociatedShape()

Gets the bounds from the associated shape, if possible.

Declaration
public void GetBoundsFromAssociatedShape()

GetCenterFromAssociatedShape()

Gets the bounds from the associated shape.

Declaration
public void GetCenterFromAssociatedShape()

RemoveIncomingEdge(Edge<TNodeData, TLinkData>)

Removes an incoming edge.

Declaration
public void RemoveIncomingEdge(Edge<TNodeData, TLinkData> edge)
Parameters
Edge<TNodeData, TLinkData> edge

The edge to remove.

Implements
INode<TNode, TLink>.RemoveIncomingEdge(TLink)

RemoveLink(Edge<TNodeData, TLinkData>)

Removes a link.

Declaration
public void RemoveLink(Edge<TNodeData, TLinkData> link)
Parameters
Edge<TNodeData, TLinkData> link

The link.

Implements
INode<TNode, TLink>.RemoveLink(TLink)

RemoveOutgoingEdge(Edge<TNodeData, TLinkData>)

Removes the given outgoing edge.

Declaration
public void RemoveOutgoingEdge(Edge<TNodeData, TLinkData> edge)
Parameters
Edge<TNodeData, TLinkData> edge

The edge to remove.

Implements
INode<TNode, TLink>.RemoveOutgoingEdge(TLink)

TransferBoundsToAssociatedShape()

Transfers the bounds to the associated shape, if possible.

Declaration
public void TransferBoundsToAssociatedShape()

TransferCenterToAssociatedShape()

Transfers the center to the associated shape, if possible.

Declaration
public void TransferCenterToAssociatedShape()

Extension Methods

CollectionExtensions.ToEnumerable<T>(T)
EnumerableExtensions.ToEnumerable<T>(T)

See Also

Edge<TNodeData, TLinkData>
Getting Started
  • Install Now
  • Demos
  • SDK Samples Browser
  • Sample Applications
Support Resources
  • Code Library
  • Knowledge Base
  • MVVM Support
  • Videos
  • GitHub SDK Repository
Community
  • Forums
  • Blogs
  • XAML Feedback Portal
  • Document Processing Feedback Portal

Copyright © 2018 Progress Software Corporation and/or its subsidiaries or affiliates.
All Rights Reserved.

Progress, Telerik, and certain product names used herein are trademarks or registered trademarks of Progress Software Corporation and/or one of its subsidiaries or affiliates in the U.S. and/or other countries. See Trademarks for appropriate markings.