Limit FromPort or ToPort By NodeType

How can i l<SPAN =short_text id=result_><SPAN =“this.style.Color=’#ebeff9’” title=限制 style=": #fff" =“this.style.Color=’#fff’”>imit FromPort or ToPort By NodeType(NodeCategory) not only by from or to SpotValue

Such as i want a Produrce node link from a Database node.
But,it is only limit by set SpotValue about the FromSpot or ToPort,Now.
How can i do it??

I think you are talking about wanting to restrict the links that users are allowed to draw. This is called link validation. There is a section about this subject in the GoXamIntro document.

You’ll want to customize the LinkingTool (and the RelinkingTool, if you support that functionality by the user) by overriding the IsValidLink method.

Or if you want to do such checking in the model, you can override the model’s CheckLinkValid method.