/// <summary> /// Update a tableEntry's EntryType /// </summary> /// <param name="tableEntryIndex">Index of entry to update</param> /// <param name="enumIndex">Updated EntryType value</param> public void UpdateEntryEntryType(int tableEntryIndex, int enumIndex) { TableEntry updatedEntry = entryTable[tableEntryIndex]; EntryType temp = EntryType.BACKGROUND_VOICE; //stub entry to get enum values updatedEntry.entryType = (EntryType)(Enum.GetValues(temp.GetType())).GetValue(enumIndex); entryTable[tableEntryIndex] = updatedEntry; }
private void ListBox_CurrentFNT_SelectionChanged(object sender, SelectionChangedEventArgs e) { if (ListBox_CurrentFNT.SelectedItem == null) { ClearUIData(); return; } var currentSubtitleIndex = currentFnt.entryTable.IndexOf((TableEntry)ListBox_CurrentFNT.SelectedItem); if (currentSubtitleIndex == -1) { ClearUIData(); return; } Button_DeleteEntry.IsEnabled = true; Button_GotoSelected.IsEnabled = true; var audioID = currentFnt.GetEntryAudioID(currentSubtitleIndex); TextBlock_SubtitleAddress.Text = currentFnt.GetEntrySubtitleAddress(currentSubtitleIndex).ToString(); TextBox_EditSubtitle.Text = currentFnt.GetEntrySubtitle(currentSubtitleIndex); TextBox_MessageIdBranchSequence.Text = currentFnt.GetEntryMessageIdBranchSequence(currentSubtitleIndex).ToString(); EntryType currentTextType = currentFnt.GetEntryEntryType(currentSubtitleIndex); ComboBox_EntryType.SelectedIndex = Array.IndexOf(Enum.GetValues(currentTextType.GetType()), currentTextType); TextBox_SubtitleActiveTime.Text = currentFnt.GetEntryActiveTime(currentSubtitleIndex).ToString(); TextBox_AudioID.Text = audioID.ToString(); if (currentAfs == null) { TextBlock_AfsAudioIDName.Text = "AFS not loaded"; Button_ExtractADX.IsEnabled = false; Button_ReplaceADX.IsEnabled = false; Button_PreviewADX.IsEnabled = false; } else if (audioID != -1 && audioID < currentAfs.Files.Count) { TextBlock_AfsAudioIDName.Text = currentAfs.Files[audioID].Name; Button_ExtractADX.IsEnabled = true; Button_ReplaceADX.IsEnabled = true; Button_PreviewADX.IsEnabled = true; } else { TextBlock_AfsAudioIDName.Text = "None"; Button_ExtractADX.IsEnabled = false; Button_ReplaceADX.IsEnabled = false; Button_PreviewADX.IsEnabled = false; } }
///<summary> This method sorts the projects with three options : all, current, promotion ///and calls the method for the display ///</summary> private static void SortCurrentOrAllProjects(EntryType target) { CurrentOrAllView ListPage = new CurrentOrAllView(target.GetType().Equals(typeof(Student))); var input = App.Renderer.Render(ListPage); string userRequest = input.GetSelectedValue(); switch (userRequest) { case "0": //All projects if (target.GetType().Equals(typeof(Student)) ^ target.GetType().Equals(typeof(Extern)) ^ target.GetType().Equals(typeof(Teacher))) { DisplayProjectList(((Person)target).Projects.ConvertAll(e => (Project)e).OrderBy(x => x.Topic).ToList()); } else if (target.GetType().Equals(typeof(FormYear))) { DisplayProjectList(((FormYear)target).AllProjects.ConvertAll(e => (Project)e).OrderBy(x => x.Topic).ToList()); } break; case "1": //Currents projects if (target.GetType().Equals(typeof(Student)) ^ target.GetType().Equals(typeof(Extern)) ^ target.GetType().Equals(typeof(Teacher))) { DisplayProjectList(((Person)target).ActiveProjects.ConvertAll(e => (Project)e).OrderBy(x => x.Topic).ToList()); } else if (target.GetType().Equals(typeof(FormYear))) { DisplayProjectList(((FormYear)target).CurrentProjects.ConvertAll(e => (Project)e).OrderBy(x => x.Topic).ToList()); } break; case "2": // //Current promotion project if (target.GetType().Equals(typeof(Student))) { DisplayProjectList(((Student)target).CurrentPromotionProjects.ConvertAll(e => (Project)e).OrderBy(x => x.Topic).ToList()); } break; } }