//Select animation from comboBox private void comboBox1_TextChanged(object sender, EventArgs e) { for(int i=0; i<animations.Count; i++) { if(comboBox1.Text.Equals(animations[i].ToString())) { anim = animations[i] as Animation; } } }
private void newButton(object sender, System.EventArgs e) { graph.Clear(); this.inkOverlay.Ink.DeleteStrokes(inkOverlay.Ink.Strokes); penButton(sender, e); if(anim != null) anim.Stop(); anim = new DijkstraAnimation(this); comboBox1.Text = anim.ToString(); togglePlayPause(PLAY); Invalidate(); }
/* Can only play animation if the home and destination nodes are set and * there are nodes in the graph */ public void AddAnimation(Animation anim) { this.anim = anim; this.comboBox1.Text = anim.ToString(); this.comboBox1.Items.Add(anim.ToString()); animations.Add(anim); }