GoSimpleNode animation

Is there a way to replicate the pulsing border effect in the AnimatedBasicApp with a GoSimpleNode the has an icon?

You should be able to use the same timing mechanism, and change the icons when the timer fires.

I was hoping to avoid having to create so many icons (there are many different icons so I would have to create 2 more variations for each of them to create that effect). Is there a way to “draw” a border around a GoSimpleNode?

The following code based on the AnimatedBasicApp sample.

Create a GoSimpleNode:

private void InsertSimpleNode (PointF pt)
{
GoSimpleNode sn = new GoSimpleNode();
sn.Initialize(Properties.Resources.ResourceManager,
“doc”, “Simple Node”);
sn.Location = pt;

// Shape around the simple node
GoRectangle shape = new GoRectangle();
shape.PenWidth = 2;
shape.PenColor = Color.Red;
shape.Selectable = false;
shape.Position = sn.Position;
shape.Size = sn.Size;
sn.InsertBefore(sn.InPort, shape);

// Add the simple node to your document
goView1.Document.Add(sn);

}

Timer tick:

private void Timer2_Tick(object sender, EventArgs e)
{
goView1.Document.SkipsUndoManager = true;

foreach (GoObject obj in goView1.Document)
{
    if (!(obj is GoSimpleNode)
        continue;
   GoSimpleNode node = ((GoSimpleNode)obj)[2] as GoRectangle;
    if (node != null)
    {
        int penWidth = (node.Penwidth == 2) ? 4 : 2;
        node.PenWidth = penWidth;
    }
}

goView1.Document.SkipsUndoManager = false;

}