Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Can I create custom link directly? (Read 1417 times)
debop
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 4
Joined: Aug 29th, 2006
Can I create custom link directly?
Dec 28th, 2007 at 5:00am
Print Post  
I want to create custom diagram link drived DiagramLink.

using UndoManager, changing link from DiagramLink to my custom link is all recorded. so undo is not proper action. (twice create link and one delete link)

Code
Select All
void ProcessDiagram_LinkCreated(object sender, LinkEventArgs e)
{
if (log.IsDebugEnabled)
log.Debug("Link Created");

if (e.Link != null)
{
CompositeCmd cmd = this.UndoManager.StartComposite("Change Link");

DiagramLink uiLink = e.Link;

ControlLink controlLink = new ControlLink(this);
controlLink.Origin = (AbstractNode)e.Link.Origin;
controlLink.Destination = (AbstractNode)e.Link.Destination;

// Link를 원하는 값으로 교체하기 위해서 DiagramLink Create Command를 Undo 한다.
//
UndoManager.Undo();

//if(this.Links.Contains(e.Link))
//{
//    this.Links.Remove(e.Link);
//    if (log.IsDebugEnabled)
//	  log.Debug("Default Link is deleted.");
//}

this.Links.Remove(e.Link);
this.Links.Add(controlLink);

cmd.Execute();
}
}
 



Can I create custom link directly?
  
Back to top
 
IP Logged
 
debop
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 4
Joined: Aug 29th, 2006
Re: Can I create custom link directly?
Reply #1 - Dec 28th, 2007 at 7:04am
Print Post  
Solve myself.

use DiagramView.CustomLinkType...

Code
Select All
_diagramView.Behavior = Behavior.Custom;
_diagramView.CustomLinkType = typeof(MyCustomLink);
_diagramView.CustomNodeType = typeof(MyCustomNode);
 

  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint