Regarding Outward Port


Author
Message
Ravali Allam
Ravali Allam
Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)
Group: Forum Members
Posts: 5, Visits: 1

Hi,

We are evaluating Nevron Diagramming for Winform for our current project. We have found it very useful till now.

We have a requirement where we need to have outward ports. But we noticed that we are not able to connect the outward ports. Please let us know if this is an issue or if there is a specific way to do it.

We greatly appreciate your support. Thanks in advance.

Regards,

Ravali Allam


Reply
Sheir Ali
Sheir Ali
Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)
Group: Forum Members
Posts: 2, Visits: 1
One of the Nevron Support team gave me some code about using my Line connector to connect two shapes (one explicitly set as PortType.Inward, shape.Name="PPMDOut")
and other shape with default Type (shape.Name = "PPMDIn").

A Connecting event handler was created.
nDrawingDocument1.EventSinkService.Connecting += new ConnectionCancelEventHandler(EventSinkService_Connecting);

///
/// This event occurs when 2 shapes arre connecting on the drawing veiw. Here is the place where you
/// can cancel the connection if you want.
///

///
private void EventSinkService_Connecting(NConnectionCancelEventArgs args)
{
NPlug plug = (NPlug)args.Document.GetDescendantFromUniqueId(args.UniqueId1, -1);
NPort port = (NPort)args.Document.GetDescendantFromUniqueId(args.UniqueId2, -1);

if (plug is NStartPlug)
{
// This is a start plug
if (port.Shape.Name == "PPMDOut")
{
// Start plug connection not allowed for Digital Output shapes - show a wanring
// message and cancel the connection
MessageBox.Show("Connecting Start Plugs to a 'Digital Output' shape is not allowed!",
"Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
args.Cancel = true;
}
}
else
{
// This is an end plug
if (port.Shape.Name == "PPMDIn")
{
// End plug connections not allowed for Digital Input shapes - show a warning
// message and cancel the connection
MessageBox.Show("Connecting End Plugs to a 'Digital Input' shape is not allowed!",
"Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
args.Cancel = true;
}
}
}


GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...





Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search