GoDiagram Web Reference
IsValidLink Method (GoToolLinking)

This predicate is called during the process of finding the nearest port that the user can link to.
Syntax
'Declaration
 
Public Overridable Function IsValidLink( _
   ByVal fromPort As IGoPort, _
   ByVal toPort As IGoPort _
) As Boolean
public virtual bool IsValidLink( 
   IGoPort fromPort,
   IGoPort toPort
)

Parameters

fromPort
toPort

Return Value

Basically this is implemented as fromPort.IsValidLink(toPort)
Remarks

If both fromPort and toPort are null, this returns false. If only one of the parameters is null, then this returns the value of fromPort.CanLinkFrom() or toPort.CanLinkTo(), on the non-null port parameter. This predicate also disallows interactive linking of a link to a port that is part of the link--e.g. linking to a port that is a label on a GoLabeledLink. The results of these calls are stored in the ValidPortsCache hash table. The ports are associated with Valid or Invalid values depending on whether this predicate returned true or false. Note that to check for links from a port to itself, this predicate may be called with the same value for both arguments.

GoPort has more options for link validity checking; see IsValidLink for more details. If you override this method, you may well need to do so for both GoToolLinkingNew and GoToolRelinking, and then replace both of the standard linking tools in your GoView by calling GoView.ReplaceMouseTool.

Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

GoToolLinking Class
GoToolLinking Members

 

 


© 2013. Northwoods Software Corporation. All Rights Reserved.

Send Feedback