예제 #1
0
        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();
        }
예제 #2
0
        private void OnVoiceKitIndexChanged(object sender, EventArgs e)
        {
            var listBox = sender as ListBox;

            currentVoiceKit = listBox.SelectedValue as VoiceKit;
            RefreshVoiceKitView();
        }
예제 #3
0
 public string GetLocalizedVoiceActorFromKit(VoiceKit kit, Language language)
 {
     if (kit != null)
     {
         VoiceActor actor = GetVoiceActor(kit.VoiceActor);
         if (actor != null)
         {
             return(actor.GetLocalizedActor(language));
         }
     }
     return("");
 }
예제 #4
0
 public string GetVoiceActorNameFromKit(VoiceKit kit)
 {
     if (kit != null)
     {
         VoiceActor actor = GetVoiceActor(kit.VoiceActor);
         if (actor != null)
         {
             return(actor.Name);
         }
     }
     return("");
 }
예제 #5
0
        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);
        }
예제 #6
0
        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();
        }