Hi there<?:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />
I need to control the adding of the links so
1. I use SepareteLayer for Links by add this line to constructor of myGoDocument
this.LinksLayer = this.Layers.CreateNewLayerAfter(this.Layers.Default);
2.I inheret from BpmnLinkingTool and override the DoNewLink as follow
public override void DoNewLink(IGoPort from, IGoPort to)
{
MainForm.App.CurrentView.StartTransaction();
IMyObject SourceNode = from.Node as IMyObject ;
IMyObject DestinationNode = to.Node as IMyObject ;
IGoLink l = MainForm.App.CurrentView.CreateLink(((GoNode)SourceNode).Por t ,(GoNode) DestinationNode).Port);
if (l != null)
{
///
///getLinkingContainer return subgraph if source and destination are in the same subgraph else it return the Linking layer
///
IGoCollection myGroup = getLinkingContainer(SourceNode,DestinationNode);
myGroup.Add (l.GoObject);
MainForm.App.CurrentView.RaiseLinkCreated(l.GoObject);
}
MainForm.App.CurrentView.FinishTransaction ("Add Link");
}
My problems are mainly is in
1. The undo of the link never happen in this case ! the link still seen in the GoView even after undo adding the nodes
2. when link a node out the subgraph to node in the subgraph then collapse the subgraph the link seem to be floating ( seems to link to hidden node the same old position of the node before collapse. so how can i change this to temporary to link to the subgraph bounders ( my subgraph already has a port) then when when expand return the links to the nodes (I think to use PrepareCollapse and PrepareExpand but I’m not sure if it’s the best way).