public static string ShowSource() { string showsource = ""; if (!Flow.GameInCategory()) { var Listing = LocalSelection.SetSelectedQASList(); showsource = Listing.Where(id => id.id.Equals(LocalSelection.SetIDs()[Flow.CurrentRound()])).Select(s => s.secondary_text).FirstOrDefault(); } else { var Listing = CategoryLoad.SetSelectedQASList(); showsource = Listing.Where(id => id.id.Equals(CategoryLoad.LoadSelectedToks()[Flow.CurrentRound()])).Select(s => s.secondary_text).FirstOrDefault(); } /* if (!CrossConnectivity.Current.IsConnected) * { * MainViewModel.MainViewModel main = new MainViewModel.MainViewModel(); * * if (Flow.GameTypeSetter().Equals(1))//Selection By Qoute * { * showsource = main.Qoutes.Where(id => id.id.Equals(IDGetter())).Select(s => s.QouteSource).FirstOrDefault(); * } * if (Flow.GameTypeSetter().Equals(2))//Selection By Sayings * { * showsource = main.Sayings.Where(id => id.id.Equals(IDGetter())).Select(s => s.SayingSource).FirstOrDefault(); * } * * } * else { * if (Flow.GameTypeSetter().Equals(1))//Selection By Qoute * { * showsource = SetOnlineQoutes().Where(id => id.QouteID.Equals(SetOnlineID())).Select(sources => sources.QoutesSource).FirstOrDefault(); * } * else { * showsource = ""; * } * }*/ return(showsource); }
public static void PhraseSelectionInitiate() { char[] trimmer = new char[] { ' ', '!', ',', '.', '/', '?', '"', ':', ';', '(', ')', '"' }; string[] splitter = { " ", "/", "...", "-", ";", ":", " " }; int selected = SelectionStart(); random = new Random(); MainViewModel.MainViewModel main = new MainViewModel.MainViewModel(); string[] disect = { " " }; var selectedphrase = ""; if (!Flow.GameInCategory()) { var Listing = LocalSelection.SetSelectedQASList(); phraselect = LocalSelection.SetIDs()[Flow.CurrentRound()]; selectedphrase = Listing.Where(qoute => qoute.id.Equals(phraselect)).Select(phrase => phrase.primary_trimmed).FirstOrDefault(); disect = selectedphrase.Split(splitter, StringSplitOptions.RemoveEmptyEntries); AllWords = disect; } else { var Listing = CategoryLoad.SetSelectedQASList(); phraselect = CategoryLoad.LoadSelectedToks()[Flow.CurrentRound()]; selectedphrase = Listing.Where(qoute => qoute.id.Equals(phraselect)).Select(phrase => phrase.primary_trimmed).FirstOrDefault(); disect = selectedphrase.Split(splitter, StringSplitOptions.RemoveEmptyEntries); AllWords = disect; } /* * bool flagcheck = true; * int infichecker = 0; * * int difficutly = Flow.DifficultyIdentifier(); * switch (difficutly) * { * case 1: * while (flagcheck) * { * infichecker++; * if (infichecker.Equals(50)) * { * diditloop = true; * } * else * { * diditloop = false; * } * * for (int i = 0; i < disect.Length; i++) * { * if (disect[i].Trim(trimmer).Length < 5) * { * flagcheck = false; * } * * } * for (int idc = 0; idc < IdBank.Length; idc++) * { * if (IdBank[idc].Equals(phraselect)) * { * flagcheck = true; * break; * } * } * * if (flagcheck) * { * * selected = SelectionStart(); * //phraselect = SelectionStart(); * phraselect = Listing[selected].id; * IDGetter(); * selectedphrase = Listing.Where(qoute => qoute.id.Equals(phraselect)).Select(phrase => phrase.primary_text).FirstOrDefault(); * disect = selectedphrase.Split(splitter, StringSplitOptions.RemoveEmptyEntries); * AllWords = disect; * } * AllWords = disect; * * } * break; * case 2: * while (flagcheck) * { * infichecker++; * if (infichecker.Equals(50)) * { * diditloop = true; * } * else * { * diditloop = false; * } * * for (int i = 0; i < disect.Length; i++) * { * if (disect[i].Trim(trimmer).Length >= 4 && disect[i].Trim(trimmer).Length <= 6) * { * flagcheck = false; * } * * } * for (int idc = 0; idc < IdBank.Length; idc++) * { * if (IdBank[idc].Equals(phraselect)) * { * flagcheck = true; * break; * } * } * if (flagcheck) * { * selected = SelectionStart(); * phraselect = Listing[selected].id; * IDGetter(); * selectedphrase = Listing.Where(qoute => qoute.id.Equals(phraselect)).Select(phrase => phrase.primary_text).FirstOrDefault(); * disect = selectedphrase.Split(splitter, StringSplitOptions.RemoveEmptyEntries); * AllWords = disect; * } * AllWords = disect; * * } * * break; * case 3: * while (flagcheck) * { * infichecker++; * if (infichecker.Equals(50)) * { * diditloop = true; * } * else * { * diditloop = false; * } * * for (int i = 0; i < disect.Length; i++) * { * if (disect[i].Trim(trimmer).Length >= 6 && disect[i].Trim(trimmer).Length <= 8) * { * flagcheck = false; * } * * } * for (int idc = 0; idc < IdBank.Length; idc++) * { * if (IdBank[idc].Equals(phraselect)) * { * flagcheck = true; * break; * } * } * if (flagcheck) * { * selected = SelectionStart(); * phraselect = Listing[selected].id; * IDGetter(); * selectedphrase = Listing.Where(qoute => qoute.id.Equals(phraselect)).Select(phrase => phrase.primary_text).FirstOrDefault(); * disect = selectedphrase.Split(splitter, StringSplitOptions.RemoveEmptyEntries); * AllWords = disect; * } * AllWords = disect; * * } * * break; * case 4: * while (flagcheck) * { * * infichecker++; * if (infichecker.Equals(50)) * { * diditloop = true; * } * else * { * diditloop = false; * } * * for (int i = 0; i < disect.Length; i++) * { * if (disect[i].Trim(trimmer).Length >= 9 && disect[i].Trim(trimmer).Length <= 12) * { * flagcheck = false; * } * * } * for (int idc = 0; idc < IdBank.Length; idc++) * { * if (IdBank[idc].Equals(phraselect)) * { * flagcheck = true; * break; * } * } * if (flagcheck) * { * selected = SelectionStart(); * phraselect = Listing[selected].id; ; * IDGetter(); * selectedphrase = Listing.Where(qoute => qoute.id.Equals(phraselect)).Select(phrase => phrase.primary_text).FirstOrDefault(); * disect = selectedphrase.Split(splitter, StringSplitOptions.RemoveEmptyEntries); * AllWords = disect; * } * AllWords = disect; * * } * * break; * }*/ GetThisPhrase(selectedphrase); IdBank[Flow.CurrentRound()] = phraselect; SelectedPhrase(); IDGetter(); }