Profile Picture

How to hide shape's port.

Posted By michal bandrowski 15 Years Ago
Author
Message
Ivo Milanov
Posted 15 Years Ago
View Quick Profile
Forum Member

Forum Member (35 reputation)Forum Member (35 reputation)Forum Member (35 reputation)Forum Member (35 reputation)Forum Member (35 reputation)Forum Member (35 reputation)Forum Member (35 reputation)Forum Member (35 reputation)Forum Member (35 reputation)

Group: Forum Members
Last Active: 2 Months Ago
Posts: 35, Visits: 15
Hi Michal,

There are several possible solutions.

Solution 1. Override the ValidateFromPort and ValidateToPort methods of the NCreateConnectorTool. If either one of this methods returns false the connector will not be displayed (I assume that you know how to replace tools - if not - please let me know and we will help).

Solution 2. Override the CanConnectPoints method of the shapes, which should discard some connections connections. Return false if a connection between an own port and a foreign connection point cannot be established.

Best regards,
Ivo

michal bandrowski
Posted 15 Years Ago
View Quick Profile
Junior Member

Junior Member (10 reputation)Junior Member (10 reputation)Junior Member (10 reputation)Junior Member (10 reputation)Junior Member (10 reputation)Junior Member (10 reputation)Junior Member (10 reputation)Junior Member (10 reputation)Junior Member (10 reputation)

Group: Forum Members
Last Active: 15 Years Ago
Posts: 10, Visits: 1
Hi,

I'm looking for another solution, becouse if I would remove a port, connections will be also lost.
I'd like to keep connections how they are, and then supress for connecting some kind of shapes be using all the time the NConnectorTool.

Mayby there is some other way (not removing ports), so I don't have to develop complex workaround ?

Pavel Vladov
Posted 15 Years Ago
View Quick Profile
Forum Member

Forum Member (34 reputation)Forum Member (34 reputation)Forum Member (34 reputation)Forum Member (34 reputation)Forum Member (34 reputation)Forum Member (34 reputation)Forum Member (34 reputation)Forum Member (34 reputation)Forum Member (34 reputation)

Group: Forum Members
Last Active: 7 Years Ago
Posts: 33, Visits: 2

Hello Michal,

 

You can remove the port from the Ports collection of the shape. For example:

shape.Ports.RemoveChildAt(0);

 

I hope this helps. Let me know if you have any questions or comments.

 

Kind regards,

Pavel



michal bandrowski
questionmark Posted 15 Years Ago
View Quick Profile
Junior Member

Junior Member (10 reputation)Junior Member (10 reputation)Junior Member (10 reputation)Junior Member (10 reputation)Junior Member (10 reputation)Junior Member (10 reputation)Junior Member (10 reputation)Junior Member (10 reputation)Junior Member (10 reputation)

Group: Forum Members
Last Active: 15 Years Ago
Posts: 10, Visits: 1
Hi,

I have view, document and a few shapes on it.
I'm facing problem how to suppress adding connection between some of shapes when using NConnectorTool.
I browsed through properties, methods, I've tired to set protection ...
and still, couldn't find how to hide port?

Can I somehow hide it or make it inaccessible for NConnectorTool ?



Thanks in advance,
Michal



Similar Topics


Reading This Topic