public static VO_Base CreateEmptyRessource(VO_Base obj) { obj.Id = Guid.Empty; obj.Title = Culture.Language.NotFound.RESSOURCE_NOT_FOUND; return(obj); }
private void ChangePlayerAnimation(object sender, EventArgs e) { VO_Base SelectedAnim = null; cmbTypeAnimation.Items.Clear(); if (characterButton1.CharacterGuid != Guid.Empty) { VO_PlayableCharacter playableCharacter = GameCore.Instance.GetPlayableCharacterById(characterButton1.CharacterGuid); List <VO_Base> AnimationList = GameCore.Instance.GetCharAnimations(playableCharacter.CharacterId); cmbTypeAnimation.DisplayMember = "Title"; cmbTypeAnimation.ValueMember = "Id"; foreach (VO_Base CurrentAnimation in AnimationList) { cmbTypeAnimation.Items.Add(CurrentAnimation); cmbTypeAnimation.SelectedIndex = 0; if (CurrentAnimation.Id == CharacterAnimationType) { SelectedAnim = CurrentAnimation; } } if (SelectedAnim != null) { cmbTypeAnimation.SelectedItem = SelectedAnim; } } }
public static bool CheckObjectExistence(VO_Base CurrentValidation) { if (CurrentValidation == null || CurrentValidation.Id == Guid.Empty) { return(false); } return(true); }
/// <summary> /// Ajoute un nouvel item à la liste /// </summary> /// <param name="pId">Id de l'item à ajouter</param> /// <param name="pTitle">Titre de l'item</param> public void AddItem(Guid id, string title) { VO_Base voBase = new VO_Base(); voBase.Id = id; voBase.Title = title; List.Items.Add(voBase); SelectItem(voBase.Id); }
private void btnValidation(object sender, EventArgs e) { CharacterId = characterButton1.CharacterGuid; AnimationType = (Enums.CharacterAnimationType)((cmbAnimation.SelectedItem.GetType()).GetProperty("Key")).GetValue(cmbAnimation.SelectedItem, null); if (cmbTypeAnimation.SelectedItem != null) { VO_Base CurrentAnimation = (VO_Base)cmbTypeAnimation.SelectedItem; CharacterAnimationType = CurrentAnimation.Id; } this.DialogResult = DialogResult.OK; this.Close(); }
private void ScriptCallGlobalEvent_Ok(object sender, EventArgs e) { if (cmbGlobalEvent.Items.Count <= 0) { MessageBox.Show(Culture.Language.Notifications.NO_GLOBALEVENT_SELECTION); } else { VO_Base CurrentEvent = (VO_Base)cmbGlobalEvent.SelectedItem; GlobalEventId = CurrentEvent.Id; this.DialogResult = DialogResult.OK; this.Close(); } }
private void AddPlayerAction_Ok(object sender, EventArgs e) { if (rdxCurrentCharacter.Checked == true) { CharacterId = new Guid(GlobalConstants.CURRENT_PLAYER_ID); } else { CharacterId = characterButton1.CharacterGuid; } if (cmbAction.SelectedItem != null) { VO_Base CurrentAction = (VO_Base)cmbAction.SelectedItem; ActionId = CurrentAction.Id; } else { ActionId = Guid.Empty; } this.DialogResult = DialogResult.OK; this.Close(); }