Hi Stoyo!
Thx for ur suggestion.
But now I need to test this:
- if there is path consisted only from kkRelationship links (parameter IeTypeOfLinks=kkRelationship)
- if there is path length 1 consisted only from kkNote links (parameter IeTypeOfLinks=kkNote)
So it seems I need to set IgnoreLayout property everytime when I need to find path - first case for kkRelationship links and in second case for kkNote links. And it seems its more complicated as my present solution when Im looking for shortest path:
- if Im checking path consisted only from kkRelationship links, I test if in finded shortest path is kkNote link. If yes, I know path is not consisted only from kkRelationship.
- if Im checking path length 1 (coz Im checking direct path between 2 nodes) consisted only from kkNote links, I test if in finded shortest path (length 1) is kkNote link. If no, I know path is not consisted only from kkNote.
'finds out if there is already connection between 2 nodes consist of specified type of links
Private Function IsPathBetweenNodes(ByVal IoStartingNode As DiagramNode, ByVal IoEndingNode As DiagramNode, ByVal IeTypeOfLinks As GeTypeOfLink) As Boolean
Dim LoPathFinder As New PathFinder(Me.fcDiagram, True)
Dim LoPath As Path = LoPathFinder.FindShortestPath(IoStartingNode, IoEndingNode)
Dim LbResult As Boolean = True
If LoPath IsNot Nothing Then
Select Case IeTypeOfLinks
Case GeTypeOfLink.kkRelationship
'checking path consist of relationship links
For Each LoLink In LoPath.Links
Select Case LoLink.GetType.Name
Case "ClsMMLinkNode"
Select Case CType(LoLink, ClsMMLinkNode).MMTypeOfLink
Case GeTypeOfLink.kkNote
LbResult = False
Exit For
End Select
Case Else
Debug.Print("CHYBA!!! - IsPathBetweenNodes - IeTypeOfLinks=kkRelationship - Select Case LoLink.GetType.Name")
End Select
Next
Case GeTypeOfLink.kkNote
'checking path length 1 consist of note links = if theres connection between 2 nodes
If LoPath.Length = 1 Then
Dim LoLink As DiagramLink = LoPath.Links(0)
Select Case LoLink.GetType.Name
Case "ClsMMLinkNode"
If CType(LoLink, ClsMMLinkNode).MMTypeOfLink = GeTypeOfLink.kkNote Then
LbResult = True
Else
LbResult = False
End If
Case Else
Debug.Print("CHYBA!!! - IsPathBetweenNodes - IeTypeOfLinks=kkNote - Select Case LoPath.Items(0).GetType.Name")
End Select
Else
LbResult = False
End If
End Select
Else
LbResult = False
End If
Return LbResult
End Function
So another suggestion? Or am I wrong with setting IgnoreLayout property of links?
thx.
...MUDO...