private void OnRemoveVoiceKit(object sender, EventArgs e) { int index = listBoxVoiceKits.SelectedIndex; if (project.ListVoiceKits.Count == 0) { return; } currentVoiceKit = null; project.ListVoiceKits.RemoveAt(index); (listBoxVoiceKits.DataSource as BindingSource).ResetBindings(false); if (project.ListVoiceKits.Count > 0) { listBoxVoiceKits.SelectedIndex = 0; if (currentVoiceKit == null) { currentVoiceKit = listBoxVoiceKits.SelectedItem as VoiceKit; RefreshVoiceKitView(); } } RefreshActorVoiceKitList(); SetDirty(); }
private void OnVoiceKitIndexChanged(object sender, EventArgs e) { var listBox = sender as ListBox; currentVoiceKit = listBox.SelectedValue as VoiceKit; RefreshVoiceKitView(); }
public string GetLocalizedVoiceActorFromKit(VoiceKit kit, Language language) { if (kit != null) { VoiceActor actor = GetVoiceActor(kit.VoiceActor); if (actor != null) { return(actor.GetLocalizedActor(language)); } } return(""); }
public string GetVoiceActorNameFromKit(VoiceKit kit) { if (kit != null) { VoiceActor actor = GetVoiceActor(kit.VoiceActor); if (actor != null) { return(actor.Name); } } return(""); }
public bool ChangeVoiceKitName(VoiceKit kit, string newName) { if (newName == String.Empty) //Forbid empty string { return(false); } if (ListVoiceKits.Any(item => item.Name == newName)) //Forbid two kits with same name { return(false); } ListActors.FindAll(item => item.VoiceKit == kit.Name).ForEach(item => item.VoiceKit = newName); kit.Name = newName; return(true); }
private void OnAddVoiceKit(object sender, EventArgs e) { VoiceKit voiceKit = new VoiceKit() { Name = "Undefined" }; project.ListVoiceKits.Add(voiceKit); (listBoxVoiceKits.DataSource as BindingSource).ResetBindings(false); listBoxVoiceKits.SelectedIndex = listBoxVoiceKits.Items.Count - 1; if (currentVoiceKit == null) //SelectedIndex will be already set on first insertion, this is a fallback for this special case { currentVoiceKit = listBoxVoiceKits.SelectedItem as VoiceKit; RefreshVoiceKitView(); } RefreshActorVoiceKitList(); SetDirty(); }