public LearnItem(string Content1, string Content2, string ImageResource) { this.Content1 = Content1; this.Content2 = Content2; this.ImageSource = ImageResource; this.Id = VocabularyFrm.AppConfig.GeneratedOrder++; Content1Lang = LearningLanguage.EN; Content2Lang = LearningLanguage.VN; }
//For Serialization public LearnItem(SerializationInfo info, StreamingContext context) { Id = (int)info.GetValue("LI_Id", typeof(int)); Content1 = (string)info.GetValue("LI_Content1", typeof(string)); Content2 = (string)info.GetValue("LI_Content2", typeof(string)); ImageSource = (string)info.GetValue("LI_ImageSource", typeof(string)); DisplayOrder = (int)info.GetValue("LI_DisplayOrder", typeof(int)); Content1Lang = (LearningLanguage)info.GetValue("LI_Content1Lang", typeof(LearningLanguage)); Content2Lang = (LearningLanguage)info.GetValue("LI_Content2Lang", typeof(LearningLanguage)); }
public LearnItem(int Order, string Content1, string Content2, string ImageResource, int DispOrder, LearningLanguage Term1Language, LearningLanguage Term2Language) { this.Content1 = Content1; this.Content2 = Content2; this.ImageSource = ImageResource; this.Id = Order; this.DisplayOrder = DispOrder; this.Content1Lang = Term1Language; this.Content2Lang = Term2Language; }
public LearnItem(int Order, string Content1, string Content2, string ImageResource, int DispOrder, LearningLanguage Term1Language, LearningLanguage Term2Language) { this.Content1 = Content1; this.Content2 = Content2; this.ImageSource = ImageResource; this.Id = Order; this.DisplayOrder = DispOrder; this.Content1Lang = Term1Language; this.Content2Lang = Term2Language; }
private List<LearnItem> ParseStringArray(string[] lines, LearningLanguage Term1Language, LearningLanguage Term2Language) { List<LearnItem> listitem = new List<LearnItem>(); int ItemCount = lines.Count(); if (ItemCount == 0) return listitem; //List<string> contents = File.ReadAllLines(path).ToList<string>(); if (Term1Language != LearningLanguage.VN) { for (int i = 0; i < ItemCount; i++) { string[] itemInLine = lines[i].Split('\t'); if (itemInLine.Count() >= 2) { LearnItem item = new LearnItem(itemInLine[0], itemInLine[1], (itemInLine.Count() >= 3 ? itemInLine[2] : null)); item.Content1Lang = Term1Language; item.Content2Lang = Term2Language; //Find tails if (i < ItemCount - 1) { for (; i < ItemCount - 1; i++) { if (lines[i + 1].Contains('\t')) { break; } else { item.Content2 += "\n" + lines[i + 1]; } } } listitem.Add(item); } } } else { for (int x = 0; x < ItemCount; x++) { string multiLineTerm = ""; for (; x < ItemCount - 1; x++) { string[] splitedItem = lines[x].Split('\t'); if (splitedItem.Count() < 2) { multiLineTerm +=lines[x] + "\n"; } else { LearnItem li = new LearnItem(multiLineTerm + splitedItem[0], splitedItem[1], (splitedItem.Count() >= 3? splitedItem[2] : null)); li.Content1Lang = Term1Language; li.Content2Lang = Term2Language; listitem.Add(li); multiLineTerm = ""; } } } } return listitem; }
public LearnItem() { Content1Lang = LearningLanguage.EN; Content2Lang = LearningLanguage.VN; }
/// <summary> /// Constructor /// </summary> /// <param name="info">Information</param> /// <param name="context">Context</param> public ResourceLink(SerializationInfo info, StreamingContext context) { path = (string)info.GetValue("AS_Path", typeof(string)); Term1Lang = (LearningLanguage)info.GetValue("AS_Term1Lang", typeof(LearningLanguage)); Term2Lang = (LearningLanguage)info.GetValue("AS_Term2Lang", typeof(LearningLanguage)); }
private List <LearnItem> ParseStringArray(string[] lines, LearningLanguage Term1Language, LearningLanguage Term2Language) { List <LearnItem> listitem = new List <LearnItem>(); int ItemCount = lines.Count(); if (ItemCount == 0) { return(listitem); } //List<string> contents = File.ReadAllLines(path).ToList<string>(); if (Term1Language != LearningLanguage.VN) { for (int i = 0; i < ItemCount; i++) { string[] itemInLine = lines[i].Split('\t'); if (itemInLine.Count() >= 2) { LearnItem item = new LearnItem(itemInLine[0], itemInLine[1], (itemInLine.Count() >= 3 ? itemInLine[2] : null)); item.Content1Lang = Term1Language; item.Content2Lang = Term2Language; //Find tails if (i < ItemCount - 1) { for (; i < ItemCount - 1; i++) { if (lines[i + 1].Contains('\t')) { break; } else { item.Content2 += "\n" + lines[i + 1]; } } } listitem.Add(item); } } } else { for (int x = 0; x < ItemCount; x++) { string multiLineTerm = ""; for (; x < ItemCount - 1; x++) { string[] splitedItem = lines[x].Split('\t'); if (splitedItem.Count() < 2) { multiLineTerm += lines[x] + "\n"; } else { LearnItem li = new LearnItem(multiLineTerm + splitedItem[0], splitedItem[1], (splitedItem.Count() >= 3? splitedItem[2] : null)); li.Content1Lang = Term1Language; li.Content2Lang = Term2Language; listitem.Add(li); multiLineTerm = ""; } } } } return(listitem); }
/// <summary> /// Constructor /// </summary> /// <param name="info">Information</param> /// <param name="context">Context</param> public ResourceLink(SerializationInfo info, StreamingContext context) { path = (string)info.GetValue("AS_Path", typeof(string)); Term1Lang = (LearningLanguage)info.GetValue("AS_Term1Lang", typeof(LearningLanguage)); Term2Lang = (LearningLanguage)info.GetValue("AS_Term2Lang", typeof(LearningLanguage)); }