/// <summary> /// /// </summary> /// <param name="animationSettings"></param> internal void SetAnimationSettings(XmlElement animationSettings) { // Reset Animation. ResetAnimation(); _items.Clear(); if (animationSettings == null) { _con.Menu.SetAnimation(false); return; } foreach (XmlElement animationSetting in animationSettings.ChildNodes) { // create animation item AnimationItemBase animationItem = null; switch (animationSetting.Name) { case "EdgeAnimationItem": animationItem = new EdgeAnimationItem(this); break; case "EntityAnimationItem": animationItem = new EntityAnimationItem(this); break; case "GraphAnimationItem": animationItem = new GraphAnimationItem(this); break; case "MassCalculationAnimationItem": animationItem = new MassCalculationAnimationItem(this); break; case "MovieAnimationItem": animationItem = new MovieAnimationItem(this); break; case "PropertyViewAnimationItem": animationItem = new PropertyViewAnimationItem(this); break; default: break; } if (animationItem == null) continue; // setup animation item. animationItem.SetAnimationStatus(animationSetting); _items.Add(animationItem); } // Activate animation. bool isAnimation = false; bool.TryParse(animationSettings.GetAttribute("IsAnimation"), out isAnimation); _con.Menu.SetAnimation(isAnimation); }
private void addEntityGraphToolStripMenuItem_Click(object sender, EventArgs e) { foreach (IAnimationItem item in this.listBox.Items) { if (!(item is GraphAnimationItem)) continue; this.panel.Controls.Clear(); this.panel.Controls.Add((AnimationItemBase)item); return; } GraphAnimationItem newItem = new GraphAnimationItem(_control); AddItem(newItem); }