/// <summary> /// Synchronise le label d'un item avec la liste d'items et le titre dans le formulaire /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void txtName_TextChanged(object sender, EventArgs e) { if (ListAnimations.ChangeItemName(CurrentAnimation.Id, txtName.Text)) { CurrentAnimation.Title = txtName.Text; } else { txtName.Text = CurrentAnimation.Title; MessageBox.Show(Errors.ERROR_UNIQUE_TITLE, Errors.ERROR_BOX_TITLE); } }
/// <summary> /// Code ajouté lors de la création d'un item /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void ListAnimations_ItemToCreate(object sender, EventArgs e) { VO_Animation newAnim = null; if (AnimationType == Enums.AnimationType.CharacterAnimation) { newAnim = _Service.CreateAnimation(ParentCharacter); } else { newAnim = _Service.CreateAnimation(AnimationType); } newAnim.Frequency = EditorSettings.Instance.AnimationFrequency; newAnim.SpriteWidth = 1; newAnim.SpriteHeight = 1; ListAnimations.AddItem(newAnim.Id, newAnim.Title); LoadAnimation(newAnim.Id); }
/// <summary> /// Charge la liste en fonction du type d'animation choisie /// </summary> private void ProvisionList() { if (AnimationType == Enums.AnimationType.CharacterAnimation) { ListAnimations.DataSource = _Service.ProvisionList(ParentCharacter); } else { ListAnimations.DataSource = _Service.ProvisionList(AnimationType); } if (CurrentAnimation != null && CurrentAnimation.Id != new Guid()) { ListAnimations.LoadList(CurrentAnimation.Id); } else { ListAnimations.LoadList(); } }