Thanks. Your answer is helpful. But I meet a new problem so I try to show you more and hope you will give me help again.
// This is only a base class, nothing else
public class EMLinkShape : DiagramLink
{
...
}
// This is the link that I want to control
public class EMLinkMessageShape : EMLinkShape
{
...
}
// My custom behavior class
internal class EMLinkMessageShapeBehavior : DrawLinksBehavior
{
public EMLinkMessageShapeBehavior(DiagramView diagramView)
: base(diagramView)
{
}
// I override below three methods to implement my control
// It can work.
protected override DiagramLink CreateLink()
{
return new EMLinkMessageShape(this.Diagram);
}
protected override void OnMouseMove(Point mousePosition)
{
// Here call my method to draw link
MyMethod(...);
}
public override InteractionState StartDraw(PointF point)
{
DiagramLink link = Diagram.GetLinkAt(point, this.Diagram.LinkHitDistance);
if (link != null)
return new InteractionState(link, 8, Action.Modify);
else
return new InteractionState(new ShapeNode(Diagram), -1, Action.Create);
}
// This is my method
protected void MyMethod(...)
{
...
link.UpdateFromPoints(); // this is last line
}
}
It can work and can finish my feature. But there is a new problem. When I modify link by mouse slowly, feature can be done excellently. But if I
move mouse quickly the result is very ugly. Like what the below picture shows
![untitled.png untitled.png](http://www.wideunion.com/temp/untitled.png)
How to solve this problem?