string pathLevel; //Se usa como indicador de nivel combinado en los ficheros de salida. Combinado nivel 1 2 3 sera 123; public HSKBooklet_Generator_A4_Vertical_OneCharacterPerPage_Acumulative(int Level) { ArrayList ArrayWords = new ArrayList(); this.Level = Level; for (int x = 1; x <= Level; x++) { //Obtener Caracteres var levelChars = charservice.GetChars(x); includedChars.AddRange(levelChars); //Obtener palabras var levelWords = listservice.GetAllWords(x); ArrayWords.AddRange(levelWords); pathLevel = pathLevel + x.ToString(); //Asi sera 1,12, 123, 1234 Y se añadira a la salida de los ficheros para formar parte del path } //Se eliminan los posibles duplicados includedChars = includedChars.Distinct().ToList(); //Ordenados ya aqui los caracteres incluidos includedChars.OrderBy(x => x.Pinyin); //Se incluyen los caracteres no las palabras List <Word> includedWords = ToList(ArrayWords); this.includedWords = includedWords.Distinct().ToList(); includedWords.OrderBy(x => x.Pinyin); }
private void JPGGenerator() { ListService service = new ListService(new Reader_HSK()); var includedWords = service.GetAllWords(1); List <Word> arrayIncluded = ToList(includedWords); int index = 1; foreach (Word_HSK w in arrayIncluded.OrderBy(x => x.NumberPinyin)) { //FANGSONG // KAITI // SIMHEI //DengXian string sIndex = NumeroCuadrado(index, 3); BitmapService.GenerateBitmapfromFontChar(w.Character, "FangSong", FontStyle.Regular, sIndex); BitmapService.GenerateBitmapfromFontChar(w.Character, "Kaiti", FontStyle.Regular, sIndex); index++; } }
public List <Tuple <string, List <int> > > HSKIndex(int Level, bool acumulative) { List <Tuple <string, List <int> > > Index = new List <Tuple <string, List <int> > >(); ArrayList includedWords = new ArrayList(); if (acumulative) { for (int i = 1; i < Level + 1; i++) { Reader_HSK reader = new Reader_HSK() { Level = i }; ListService service = new ListService(reader); var levelwords = service.GetAllWords(i); includedWords.AddRange(levelwords); } } else { Reader_HSK reader = new Reader_HSK() { Level = Level }; ListService service = new ListService(reader); var levelwords = service.GetAllWords(Level); includedWords.AddRange(levelwords); } //Argh List <Word> arrayIncluded = ToList(includedWords); foreach (HSK.Word_HSK w in arrayIncluded.OrderBy(x => x.NumberPinyin)) { List <int> pagesthatcontainsword = new List <int>(); string HSKWord = w.Character; foreach (var page in document) { if (page.Item2.Contains(HSKWord)) { if (!pagesthatcontainsword.Contains(page.Item1)) { pagesthatcontainsword.Add(page.Item1); } } } Index.Add(new Tuple <string, List <int> >(w.Character, pagesthatcontainsword)); } return(Index); }
public HSKBooklet_Generator_A4_Vertical_OneCharacterPerPage(int Level, bool Acumulative) { this.Level = Level; //Obtener Caracteres includedChars = charservice.GetChars(Level); //Obtener palabras includedWords = listservice.GetAllWords(Level); }
private ArrayList LoadIncluded(int Level) { ArrayList includedWords = new ArrayList(); ListService listService = null; //TODO Cargar Varios Niveles if ((Level >= 0) && (Level <= 6)) { listService = new ListService(new DALReaders.Reader_HSK { Level = Level }); includedWords.AddRange(listService.GetAllWords(Level)); } else if (Level == 13) { listService = new ListService(new DALReaders.Reader_HSK { Level = 1 }); includedWords.AddRange(listService.GetAllWords(1)); listService = new ListService(new DALReaders.Reader_HSK { Level = 2 }); includedWords.AddRange(listService.GetAllWords(2)); listService = new ListService(new DALReaders.Reader_HSK { Level = 3 }); includedWords.AddRange(listService.GetAllWords(3)); } else if (Level == 14) { listService = new ListService(new DALReaders.Reader_HSK { Level = 1 }); includedWords.AddRange(listService.GetAllWords(1)); listService = new ListService(new DALReaders.Reader_HSK { Level = 2 }); includedWords.AddRange(listService.GetAllWords(2)); listService = new ListService(new DALReaders.Reader_HSK { Level = 3 }); includedWords.AddRange(listService.GetAllWords(3)); listService = new ListService(new DALReaders.Reader_HSK { Level = 4 }); includedWords.AddRange(listService.GetAllWords(4)); } //RANDOM ORDER HERE return(RandomOrder(includedWords)); }
public LevelListViewModel(int level) { //TODO DALReaders.Reader_HSK reader_HSK = new DALReaders.Reader_HSK(); reader_HSK.Level = level; ListService listservice = new ListService(reader_HSK); System.Collections.ArrayList words = listservice.GetAllWords(level); foreach (HSK.Word_HSK w in words) { Items.Add(w); } }